actor PastMinionWep_NormalBar : NormalBar{args 4, 103}
actor PastMinionWep : BaseMM8BDMWep 
{
Weapon.AmmoUse 1
Weapon.AmmoGive 28
Weapon.SlotNumber 7
Inventory.Pickupmessage "$PU_PASTMINION"
Obituary "$OB_PASTMINION"
Tag "$TAG_PASTMINION"
weapon.ammotype "PastMinionAmmo"
inventory.icon "PMNNICON"
States
{
SpawnLoop:
PMNN Z 1
loop
Ready:
PMNN A 0 ACS_NamedExecuteWithResult("core_weaponcolor",COLOR_PASTMINION)
PMNN A 2 A_GunFlash
Ready2:
TNT1 A 0 A_JumpIfInventory("PastSelectFlag",4,"ReadyVenus")
TNT1 A 0 A_JumpIfInventory("PastSelectFlag",3,"ReadySolar")
TNT1 A 0 A_JumpIfInventory("PastSelectFlag",2,"ReadyWood")
TNT1 A 0 A_JumpIfInventory("PastSelectFlag",1,"ReadySkull")
goto ReadySkull
ReadyC: Goto Ready2
ReadyVenus:
PMNN A 0 A_Gunflash("Flash.Venus")
PMNN AAAA 1 A_WeaponReady
goto Ready2
ReadySolar:
PMNN A 0 A_Gunflash("Flash.Solar")
PMNN AAAA 1 A_WeaponReady
goto Ready2
ReadyWood:
PMNN A 0 A_Gunflash("Flash.Wood")
PMNN AAAA 1 A_WeaponReady
goto Ready2
ReadySkull:
PMNN A 0 A_Gunflash("Flash.Skull")
PMNN AAAA 1 A_WeaponReady
goto Ready2
Deselect:
PMNN A 0 
goto DeselectSwap
Select:
PMNN A 0 A_GiveInventory("PastMinionStartup_P",1)
goto SelectSwap
Fire:
PMNN A 0 A_JumpIfInventory("PastMinionFlag",1,"Fire2")
PMNN A 0 A_JumpIfNoAmmo("NoAmmo")
PMNN B 0 A_GiveInventory("ShieldCheck",1)
PMNN BC 1
PMNN B 0 A_TakeInventory("ShieldCheck",1)
PMNN B 0 A_PlaySoundEx("weapon/pastsummon","Weapon")
PMNN A 0 A_SpawnItemEx("PastMinion_AttackWatcher")
PMNN A 0 A_SpawnItemEx("PastMinion_AmmoWatcher")
PMNN A 0 A_SpawnItemEx("PastMinion_FloatingHead")
PMNN A 0 A_GiveInventory("PastMinionFlag",1)
PMNN DDC 4
PMNN BA 6
PMNN A 2 A_Refire
goto Ready2
Fire2:
PMNN A 0 A_JumpIfNoAmmo("NoAmmo")
PMNN BC 1
PMNN B 0 A_PlaySoundEx("weapons/mmv/blackholetrigger","Weapon")
PMNN A 0 A_TakeInventory("PastMinionFlag",1)
PMNN A 0 A_GiveInventory("ShieldCheck",1)
PMNN DDC 3
PMNN BA 5
PMNN A 2
PMNN A 0 A_TakeInventory("ShieldCheck",1)
goto Ready2
Altfire:
PMNN A 0 A_JumpIfInventory("PastMinionFlag",1,"Fire2")
PMNN B 0 A_PlaySoundEx("menu/cursor","Weapon")
PMNN E 3 A_Gunflash("Flash.Hold")
PMNN E 0 A_GiveInventory("PastMinionChange",1)
PMNN A 3 A_Gunflash
PMNN A 3
goto Ready2

NoAmmo:
PMNN A 0 ACS_NamedExecuteAlways("core_noammo",0)
Goto Ready2

Flash:
PMNN OQ 2
loop
Flash.Skull:
PMNN FJ 2
loop
Flash.Wood:
PMNN GK 2
loop
Flash.Solar:
PMNN HL 2
loop
Flash.Venus:
PMNN IM 2
loop
Flash.Hold:
PMNN NPNPNPNPNP 2
goto Flash
}
}

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

actor PastMinionFlag : Once {}
//actor PastMinionDie : Once {}
actor PastSelectFlag : CutterFlag {}
actor PastMinionGivenFlag : Once {}

actor PastMinionStartup_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0
TNT1 A 0 A_JumpIfInventory("PastMinionGivenFlag",1,"NullState")
TNT1 A 0 A_GiveInventory("PastSelectFlag",1)
TNT1 A 0 A_GiveInventory("PastMinionGivenFlag",1)
stop
NullState:
TNT1 A 0
stop
}
}

actor PastMinionChange : CustomInventory
{
States
{
Pickup:
TNT1 A 0
TNT1 A 0 A_JumpIfInventory("PastSelectFlag",4,"Reset")
TNT1 A 0 A_GiveInventory("PastSelectFlag",1)
stop
Reset:
TNT1 A 0 A_TakeInventory("PastSelectFlag",999)
TNT1 A 0 A_GiveInventory("PastSelectFlag",1)
stop
}
}

actor PastMinion_FloatingHead : BasicGraphicEffect
{
+BRIGHT
renderstyle "translucent"
scale 2.5
alpha 1.0
States
{
SpawnFrame:
TNT1 A 0
TNT1 A 0 A_JumpIfInTargetInventory("PastSelectFlag",4,"FrameVenus")
TNT1 A 0 A_JumpIfInTargetInventory("PastSelectFlag",3,"FrameSolar")
TNT1 A 0 A_JumpIfInTargetInventory("PastSelectFlag",2,"FrameWood")
TNT1 A 0 A_JumpIfInTargetInventory("PastSelectFlag",1,"FrameSkull")
goto FrameSkull
FrameSkull:
PMNP U 0 A_JumpIfInTargetInventory("ShieldCheck",1,"Death")
PMNP U 1 A_Warp(AAPTR_TARGET, 0, 0, 72, 0, WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
PMNP U 0 A_SetTranslucent(0.33)
PMNP U 0 A_JumpIfInTargetInventory("ShieldCheck",1,"Death")
PMNP U 1 A_Warp(AAPTR_TARGET, 0, 0, 72, 0, WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
PMNP U 0 A_SetTranslucent(1.0)
PMNP U 0 A_JumpIfInTargetInventory("PastMinionFlag",1,"SpawnFrame")
stop
FrameWood:
PMNP U 0 A_JumpIfInTargetInventory("ShieldCheck",1,"Death")
PMNP V 1 A_Warp(AAPTR_TARGET, 0, 0, 72, 0, WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
PMNP V 0 A_SetTranslucent(0.33)
PMNP U 0 A_JumpIfInTargetInventory("ShieldCheck",1,"Death")
PMNP V 1 A_Warp(AAPTR_TARGET, 0, 0, 72, 0, WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
PMNP V 0 A_SetTranslucent(1.0)
PMNP V 0 A_JumpIfInTargetInventory("PastMinionFlag",1,"SpawnFrame")
stop
FrameSolar:
PMNP U 0 A_JumpIfInTargetInventory("ShieldCheck",1,"Death")
PMNP W 1 A_Warp(AAPTR_TARGET, 0, 0, 72, 0, WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
PMNP W 0 A_SetTranslucent(0.33)
PMNP U 0 A_JumpIfInTargetInventory("ShieldCheck",1,"Death")
PMNP W 1 A_Warp(AAPTR_TARGET, 0, 0, 72, 0, WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
PMNP W 0 A_SetTranslucent(1.0)
PMNP W 0 A_JumpIfInTargetInventory("PastMinionFlag",1,"SpawnFrame")
stop
FrameVenus:
PMNP U 0 A_JumpIfInTargetInventory("ShieldCheck",1,"Death")
PMNP X 1 A_Warp(AAPTR_TARGET, 0, 0, 72, 0, WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
PMNP X 0 A_SetTranslucent(0.33)
PMNP U 0 A_JumpIfInTargetInventory("ShieldCheck",1,"Death")
PMNP X 1 A_Warp(AAPTR_TARGET, 0, 0, 72, 0, WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
PMNP X 0 A_SetTranslucent(1.0)
PMNP X 0 A_JumpIfInTargetInventory("PastMinionFlag",1,"SpawnFrame")
stop
Death:
TNT1 A 0 A_TakeFromTarget("PastMinionFlag",20)
TNT1 A 5
stop
}
}

actor PastMinion_AmmoWatcher : BasicWatcher
{
    States
    {
    Spawn:
        TNT1 A 0
		TNT1 A 0 A_JumpIfInTargetInventory("PastMinionAmmo",1,"Spawn2")
		TNT1 A 8 A_GiveToTarget("ShieldCheck",1)
		TNT1 A 0 A_TakeFromTarget("PastMinionFlag",1)
		TNT1 A 2 A_TakeFromTarget("ShieldCheck",1)
		stop
	Spawn2:
		TNT1 A 0 A_JumpIfInTargetInventory("PastMinionFlag",1,"TakeAmmo")
        stop
		TakeAmmo:
		TNT1 A 0 A_TakeFromTarget("PastMinionAmmo",1)
		TNT1 A 24
		goto Spawn
    }
}

actor PastMinion_AttackWatcher : BasicWatcher
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_JumpIfInTargetInventory("PastMinionFlag",1,"Attack")
stop
Attack:
TNT1 AAAAAAAAAA 2 A_JumpIfInTargetInventory("ShieldCheck",1,"Die")
TNT1 A 0 A_JumpIfInTargetInventory("PastSelectFlag",4,"AttackVenus")
TNT1 A 0 A_JumpIfInTargetInventory("PastSelectFlag",3,"AttackSolar")
TNT1 A 0 A_JumpIfInTargetInventory("PastSelectFlag",2,"AttackWood")
TNT1 A 0 A_JumpIfInTargetInventory("PastSelectFlag",1,"AttackSkull")
stop
AttackSkull:
TNT1 A 0 A_Warp(AAPTR_TARGET, 0, 0, 32, 0, WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
TNT1 A 0 A_GiveToTarget("PastMinion_BusterSound",1)
TNT1 A 0 A_SpawnItemEx("PastMinion_SkullShot",0,0,0,32,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("PastMinion_SkullShot",0,0,0,-32,0,0,0,1)
TNT1 AA 2 A_JumpIfInTargetInventory("ShieldCheck",1,"Die")
TNT1 A 0 A_JumpIfInTargetInventory("PastMinionFlag",1,1)
goto Die
TNT1 A 0 A_Warp(AAPTR_TARGET, 0, 0, 32, 0, WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
TNT1 A 0 A_GiveToTarget("PastMinion_BusterSound",1)
TNT1 A 0 A_SpawnItemEx("PastMinion_SkullShot",0,0,0,32,0,0,45,1)
TNT1 A 0 A_SpawnItemEx("PastMinion_SkullShot",0,0,0,-32,0,0,45,1)
TNT1 AA 2 A_JumpIfInTargetInventory("ShieldCheck",1,"Die")
TNT1 A 0 A_JumpIfInTargetInventory("PastMinionFlag",1,1)
goto Die
TNT1 A 0 A_Warp(AAPTR_TARGET, 0, 0, 32, 0, WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
TNT1 A 0 A_GiveToTarget("PastMinion_BusterSound",1)
TNT1 A 0 A_SpawnItemEx("PastMinion_SkullShot",0,0,0,32,0,0,90,1)
TNT1 A 0 A_SpawnItemEx("PastMinion_SkullShot",0,0,0,-32,0,0,90,1)
TNT1 AA 2 A_JumpIfInTargetInventory("ShieldCheck",1,"Die")
TNT1 A 0 A_JumpIfInTargetInventory("PastMinionFlag",1,1)
goto Die
TNT1 A 0 A_Warp(AAPTR_TARGET, 0, 0, 32, 0, WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
TNT1 A 0 A_GiveToTarget("PastMinion_BusterSound",1)
TNT1 A 0 A_SpawnItemEx("PastMinion_SkullShot",0,0,0,32,0,0,135,1)
TNT1 A 0 A_SpawnItemEx("PastMinion_SkullShot",0,0,0,-32,0,0,135,1)
TNT1 AA 2 A_JumpIfInTargetInventory("ShieldCheck",1,"Die")
TNT1 A 0 A_JumpIfInTargetInventory("PastMinionFlag",1,1)
goto Die
TNT1 A 0
goto AttackSkull

AttackWood:
TNT1 A 0 A_Warp(AAPTR_TARGET, 0, 0, 32, 0, WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
TNT1 A 0 A_GiveToTarget("PastMinion_LeafSound",1)
TNT1 A 0 A_SpawnItemEx("PastMinion_WoodLeaf",96,0,0,0,0,64,0,1)
TNT1 A 0 A_SpawnItemEx("PastMinion_WoodLeaf",96,0,0,0,0,64,45,1)
TNT1 A 0 A_SpawnItemEx("PastMinion_WoodLeaf",96,0,0,0,0,64,90,1)
TNT1 A 0 A_SpawnItemEx("PastMinion_WoodLeaf",96,0,0,0,0,64,135,1)
TNT1 A 0 A_SpawnItemEx("PastMinion_WoodLeaf",96,0,0,0,0,64,180,1)
TNT1 A 0 A_SpawnItemEx("PastMinion_WoodLeaf",96,0,0,0,0,64,225,1)
TNT1 A 0 A_SpawnItemEx("PastMinion_WoodLeaf",96,0,0,0,0,64,270,1)
TNT1 A 0 A_SpawnItemEx("PastMinion_WoodLeaf",96,0,0,0,0,64,315,1)
TNT1 AAAAA 2 A_JumpIfInTargetInventory("ShieldCheck",1,"Die")
TNT1 A 0 A_JumpIfInTargetInventory("PastMinionFlag",1,1)
goto Die
TNT1 A 0 
goto AttackWood

AttackSolar:
TNT1 A 0 A_Warp(AAPTR_TARGET, 0, 0, 32, 0, WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
TNT1 A 0 A_GiveToTarget("PastMinion_SolarSound",1)
TNT1 A 0 A_GiveToTarget("PastMinion_SolarSpawn",1)
AttackSolar2:
TNT1 A 0 A_Warp(AAPTR_TARGET, 0, 0, 32, 0, WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
TNT1 A 1 A_JumpIfInTargetInventory("ShieldCheck",1,"Die")
loop

AttackVenus:
TNT1 A 0 A_Warp(AAPTR_TARGET, 0, 0, 32, 0, WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
TNT1 A 0 A_GiveToTarget("PastMinion_BubbleSound",1)
TNT1 A 0 A_SpawnItemEx("PastMinion_BubbleBomb",0,0,0,24,0,0,32,1)
TNT1 A 0 A_SpawnItemEx("PastMinion_BubbleBomb",0,0,0,24,0,0,148,1)
TNT1 A 0 A_SpawnItemEx("PastMinion_BubbleBomb",0,0,0,24,0,0,212,1)
TNT1 A 0 A_SpawnItemEx("PastMinion_BubbleBomb",0,0,0,24,0,0,328,1)
TNT1 AAAAAAAAAAAAAAAA 2 A_JumpIfInTargetInventory("ShieldCheck",1,"Die")
TNT1 A 0 A_JumpIfInTargetInventory("PastMinionFlag",1,1)
goto Die
TNT1 A 0 A_Warp(AAPTR_TARGET, 0, 0, 32, 0, WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
TNT1 A 0 A_GiveToTarget("PastMinion_BubbleSound",1)
TNT1 A 0 A_SpawnItemEx("PastMinion_BubbleBomb2",0,0,0,24,0,0,32,1)
TNT1 A 0 A_SpawnItemEx("PastMinion_BubbleBomb2",0,0,0,24,0,0,148,1)
TNT1 A 0 A_SpawnItemEx("PastMinion_BubbleBomb2",0,0,0,24,0,0,212,1)
TNT1 A 0 A_SpawnItemEx("PastMinion_BubbleBomb2",0,0,0,24,0,0,328,1)
TNT1 AAAAAAAAAAAAAAAA 2 A_JumpIfInTargetInventory("ShieldCheck",1,"Die")
TNT1 A 0 A_JumpIfInTargetInventory("PastMinionFlag",1,1)
goto Die
TNT1 A 0
goto AttackVenus
Die:
TNT1 A 3
stop
}
}

actor PastMinion_BusterSound : CustomInventory
{ states { Pickup: TNT1 A 0 A_PlaySoundEx("weapons/busters/megabusterfire", "Auto",0) stop } }
actor PastMinion_LeafSound : CustomInventory
{ states { Pickup: TNT1 A 0 A_PlaySoundEx("weapons/mm2/leafshieldactive", "Auto", 0) stop } }
actor PastMinion_SolarSound : CustomInventory
{ states { Pickup: TNT1 A 0 A_PlaySoundEx("weapons/mm10/solarblazefire","Auto") stop } }
actor PastMinion_BubbleSound : CustomInventory
{ states { Pickup: TNT1 A 0 A_PlaySoundEx("weapon/bubblebomb", "Auto",0) stop } }


actor PastMinion_SkullShot : BasicProjectile
{
+BRIGHT
//+DONTREFLECT
renderstyle "translucent"
damagetype "PastMinionSkull"
Obituary "$OB_PASTMINION"
PROJECTILE
Damage (CallACS("vile_cbm_damage",12))
speed 32
Scale 2.5
Height 12
Radius 12
States
{
Spawn:
TNT1 A 0
PMNP H 0 ACS_NamedExecuteWithResult("core_alphaprojectile", CallACS("core_getptrtid", AAPTR_TARGET), APROJ_TEAM, 6553, 192) // 6553 = 0.1 * 65536
PMNP ABCDEFGH 2
loop
}
}

actor PastMinion_WoodLeaf : BasicProjectile
{
+BRIGHT
+SKYEXPLODE
damagetype "PastMinionLeaf"
Obituary "$OB_PASTMINION"
PROJECTILE
+THRUACTORS
+RIPPER
scale 2.5
height 32
radius 32
Damage (0)
speed 0
states
{
	Spawn:
	TNT1 A 0
	TNT1 A 2
	goto Death
	Death:
	TNT1 A 0 A_SpawnItemEx("PastMinion_WoodLeaf2", 0, 0, 0, 0, 0, -12, 0, SXF_WEPFXCOLOR)
	stop
}
}

actor PastMinion_WoodLeaf2 : BasicProjectile
{
+BRIGHT
renderstyle "translucent"
damagetype "PastMinionLeaf"
Obituary "$OB_PASTMINION"
PROJECTILE
+THRUACTORS
scale 2.5
height 32
radius 32
Damage (CallACS("vile_cbm_damage",8))
speed 0
states
{
	Spawn:
	PMN2 A 0
	PMN2 A 0 ACS_NamedExecuteWithResult("core_alphaprojectile", CallACS("core_getptrtid", AAPTR_TARGET), APROJ_TEAM, 32765, 40) // 6553 = 0.1 * 65536 // 6553 = 0.1 * 65536
	PMN2 A 2
	PMN2 A 0 A_ChangeFlag("THRUACTORS",0)
	Spawn2:
	PMN2 BCDEFA 2
	loop
}
}

actor PastMinion_BubbleBomb : BubbleBomb
{
+BRIGHT
renderstyle "translucent"
damagetype "PastMinionBubble"
Obituary "$OB_PASTMINION"
    States
    {
    Spawn:
        TNT1 A 0
		TNT1 A 0 ACS_NamedExecuteWithResult("core_alphaprojectile", CallACS("core_getptrtid", AAPTR_TARGET), APROJ_TEAM, 6553, 192) // 6553 = 0.1 * 65536
        TNT1 A 0 A_SetUserVar("user_DIRECTION",1)
        TNT1 A 0 A_SetUserVar("user_SPEED", 6)
        goto SpawnStart
    SpawnStart:
        PMNP IJ 1 A_Changevelocity(0, -(user_SPEED/2)*user_DIRECTION,0,1)
        PMNP I 0 A_Changevelocity(0, 3*user_SPEED*user_DIRECTION,0,1)
        goto SpawnLoop
    SpawnLoop:
        PMNP KLM 2
        PMNP LK 3 A_Changevelocity(0,-user_SPEED*user_DIRECTION,0,1)
        PMNP LM 3 A_Changevelocity(0,-user_SPEED*user_DIRECTION,0,1)
        PMNP LKM 2
        PMNP LK 3 A_Changevelocity(0,user_SPEED*user_DIRECTION,0,1)
        PMNP LM 3 A_Changevelocity(0,user_SPEED*user_DIRECTION,0,1)
        loop
    Death:
        PMNP A 0 A_Stop
        PMNP A 0 A_SpawnItemEx("SoakifyEffect")
        PMNP A 0 A_PlaySoundEx("weapons/mmv/bubblebombexplode", "Weapon")
        PMNP A 0 A_Explode(CallACS("vile_cbm_damage",16), 96, 0, 0, 48)
        TNT1 A 35 A_SpawnItemEx("ExplosionEffect2", 0, 0, 0, 0, 0, 0, 0, SXF_WEPFXCOLOR)
        stop
    }
}

actor PastMinion_BubbleBomb2 : PastMinion_BubbleBomb
{
    States
    {
    Spawn:
        TNT1 A 1
		TNT1 A 0 ACS_NamedExecuteWithResult("core_alphaprojectile", CallACS("core_getptrtid", AAPTR_TARGET), APROJ_TEAM, 6553, 192) // 6553 = 0.1 * 65536
		TNT1 A 0 A_SetUserVar("user_DIRECTION",-1)
        TNT1 A 0 A_SetUserVar("user_SPEED", 6)
        goto SpawnStart
    }
}

actor PastMinion_SolarSpawn : CustomInventory
{
States
{
Pickup:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("PastMinion_SolarBlaze",0,0,0,0,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("PastMinion_SolarBlaze",0,0,0,0,0,0,180,1)
stop
}
}

actor PastMinion_SolarBlaze : BasicProjectile
{
    +NOCLIP
    +ACTIVATEIMPACT
    +ACTIVATEPCROSS
    +DONTREFLECT
    +DONTSPLASH
    +DONTBLAST
    +DONTRIP
    +NOBLOOD
    +FORCEXYBILLBOARD
    +MOVEWITHSECTOR
    +NOTAUTOAIMED
    +BRIGHT
    maxstepheight 0
    Scale 2.5
    height 36
    radius 36
	damagetype "PastMinionSolar"
    Obituary "$OB_PASTMINION"
    var int user_radius;
    var int user_angle;
    var int user_angleadd;
    var int user_expandtime;
	renderstyle "translucent"

    States
    {
    Spawn:
		PMNP A 0
		PMNP A 0 A_GiveInventory("MM8BDMProjSpawnFunc",1)
		PMNP A 0 A_SetUserVar(user_radius, 32)
		PMNP A 0 A_SetUserVar(user_angleadd, 0)
		PMNP A 0 A_SetUserVar(user_expandtime, 16)
		PMNP A 0 A_SetUserVar(user_angle, angle)
		PMNP A 0 ACS_NamedExecuteWithResult("core_alphaprojectile", CallACS("core_getptrtid", AAPTR_TARGET), APROJ_TEAM, 32765, 40) // 6553 = 0.1 * 65536
		goto Expand
    SpawnLoop:
		PMNP R 0 A_JumpIf(ACS_NamedExecuteWithResult("core_targetexists")==0,"End")
		PMNP R 0 A_JumpIfInTargetInventory("ShieldCheck", 1, "Detonate")
		PMNP R 0 A_SetUserVar(user_angle, user_angle-user_angleadd)
		PMNP R 1 A_Warp(AAPTR_TARGET, cos(-user_angle)*user_radius, sin(-user_angle)*user_radius, 32, 0, WARPF_ABSOLUTEANGLE|WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION) 
		PMNP S 0 A_JumpIfInTargetInventory("ShieldCheck", 1, "Detonate")
		PMNP S 0 A_SetUserVar(user_angle, user_angle-user_angleadd)
		PMNP S 1 A_Warp(AAPTR_TARGET, cos(-user_angle)*user_radius, sin(-user_angle)*user_radius, 32, 0, WARPF_ABSOLUTEANGLE|WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION) 
		PMNP S 0 A_JumpIfInTargetInventory("ShieldCheck", 1, "Detonate")
		PMNP T 0 A_Explode(CallACS("vile_cbm_damage",15),32,0,0,32)
		PMNP T 0 A_SetUserVar(user_angle, user_angle-user_angleadd)
		PMNP T 1 A_Warp(AAPTR_TARGET, cos(-user_angle)*user_radius, sin(-user_angle)*user_radius, 32, 0, WARPF_ABSOLUTEANGLE|WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION) 
		PMNP T 0 A_JumpIfInTargetInventory("ShieldCheck", 1, "Detonate")
		loop
    Expand:
		PMNP N 0 A_SetUserVar(user_angleadd, user_angleadd+1)
		PMNP N 0 A_SetUserVar(user_expandtime, user_expandtime-1)
		PMNP N 0 A_SetUserVar(user_angle, user_angle-user_angleadd)

		PMNP N 1 A_Warp(AAPTR_TARGET, cos(-user_angle)*user_radius, sin(-user_angle)*user_radius, 32, 0, WARPF_ABSOLUTEANGLE|WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
		PMNP N 0 A_SetUserVar(user_radius, user_radius+4)
		PMNP N 0 A_SetUserVar(user_angle, user_angle-user_angleadd)
		PMNP N 0 A_Explode(CallACS("vile_cbm_damage",8),8,0,0,8)
		PMNP O 1 A_Warp(AAPTR_TARGET, cos(-user_angle)*user_radius, sin(-user_angle)*user_radius, 32, 0, WARPF_ABSOLUTEANGLE|WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
		PMNP O 0 A_JumpIf(user_expandtime <= 5, "Expand2")
		PMNP O 0 A_JumpIfInTargetInventory("ShieldCheck", 1, "Detonate")
		loop
    Expand2:
		PMNP P 0 A_SetUserVar(user_angleadd, user_angleadd+2)
		PMNP P 0 A_SetUserVar(user_expandtime, user_expandtime-1)
		PMNP P 0 A_SetUserVar(user_angle, user_angle-user_angleadd)

		PMNP P 1 A_Warp(AAPTR_TARGET, cos(-user_angle)*user_radius, sin(-user_angle)*user_radius, 32, 0, WARPF_ABSOLUTEANGLE|WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
		PMNP P 0 A_SetUserVar(user_radius, user_radius+4)
		PMNP P 0 A_SetUserVar(user_angle, user_angle-user_angleadd)
		PMNP Q 0 A_Explode(CallACS("vile_cbm_damage",8),16,0,0,16)
		PMNP Q 1 A_Warp(AAPTR_TARGET, cos(-user_angle)*user_radius, sin(-user_angle)*user_radius, 32, 0, WARPF_ABSOLUTEANGLE|WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
		PMNP Q 0 A_JumpIf(user_expandtime <= 0, "SpawnLoop")
		PMNP Q 0 A_JumpIfInTargetInventory("ShieldCheck", 1, "Detonate")
		loop
    Death:
    Detonate:
		PMNP A 0
		MMFX BCDE 2
		stop
    End:
		PMNP H 0
		stop
    }
}
