actor BusterRodGBombFlierAssist
{
height 4
radius 24
scale 2.5
+FORCEYBILLBOARD
+NOGRAVITY
+SHOOTABLE
+THRUGHOST
+CANPASS
+NOBLOCKMONST
+DONTBLAST
+SOLID
+DONTREFLECT
+MISSILE
+NODAMAGE
+INVULNERABLE
+NOTAUTOAIMED
species "MovingPlatform"
+THRUSPECIES
var int user_playerRiding[64];
mass 99999999
//ReactionTime 50
var int user_countdown;
maxstepheight 0
States
{
Spawn:
TNT1 AA 0 A_GiveInventory("ProjectileCode", 1)
BFLI B 0 ACS_NamedExecuteAlways("core_targetyawpitch", 0, 0)
BFLI B 0 A_Stop
BFLI B 0 A_ChangeFlag(SOLID,0)
BFLI B 0 A_RearrangePointers(AAPTR_DEFAULT, AAPTR_TARGET)
BFLI B 0 A_Cleartarget
Waiting:
BFLI B 0 A_SpawnItemEx("Item2Detect", 0, 0, 32)
BFLI B 0 A_JumpIfInventory("GutsManThrowBlockTrigger", 1, "Fire",AAPTR_MASTER)
BFLI B 3 A_SetUserVar("user_countdown", user_countdown + 1)
BFLI B 0 A_JumpIf(user_countdown == 70, "Death")
BFLI B 0 A_JumpIfInventory("Item2Flag", 1, "MoveStart")
Loop
MoveStart:
TNT1 A 0 A_PlaySoundEx("weapon/gyroalt","Body")
TNT1 A 0 A_GiveInventory("BombFlierCounter",68,AAPTR_MASTER)
TNT1 A 1 A_GiveInventory("BombFlierActivate",1,AAPTR_MASTER)
stop

Death:
BFLI A 0 A_TakeInventory("BRGAssist",1,0,AAPTR_MASTER)
BFLI A 0 A_RearrangePointers(AAPTR_MASTER)
BFLI A 0 A_SpawnItemEx("BombFlierDeath", 0, 0, height/2, 0, 0, 0, 0, SXF_TRANSFERPOINTERS)
stop

Fire:

BFLI A 0 A_RearrangePointers(AAPTR_MASTER)
BFLI D 0 A_GiveToTarget("TargetMarker", 1)
BFLI D 1 ACS_NamedExecuteAlways("core_aimattargetcursor", 0, CallACS("core_gettarget")+PLN_TARGETPOINT_OFFSET, 32)
BFLI D 0 A_CustomMissile("DiveManTorpedo",16,0,0,2,-pitch)
TNT1 A 0 A_GiveToTarget("FlyDeactivate",1)
stop
}
}

actor BombFlierDeath
{
projectile
Obituary "$OB_BOMBFLY"
States
{
Spawn:
BFLI A 0
BFLI A 0 A_Explode(16, 120, 0, 0, 60)
BFLI A 0 A_SpawnItemEx("ParocketExplosionFX", 0, 0, height/2)
stop
}
}


actor BombFlierTeleport
{
Translation "192:192=8:8", "198:198=4:4"
+MISSILE
+THRUACTORS
+NOGRAVITY
+NOINTERACTION
+DONTREFLECT
Scale 2.5
ReactionTime 10
States
{
Spawn:
TNT1 AA 0 A_GiveInventory("ProjectileCode", 1)
TFOG A 6
Idle:
TFOG A 1 A_CheckFloor("Death")
TFOG A 0 A_Countdown
loop

Death:
//spawn capsule
TNT1 A 0 A_Stop
TFOG B 4
TFOG C 4 A_SpawnItemEx("BusterRodGBombFlierAssist", 0, 0, 32, 0, 0, 0, 0, SXF_TRANSFERPOINTERS)
stop
}
}



actor BombFlierActivate : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
+AUTOACTIVATE
states
{
Pickup:
TNT1 A 0 A_SpawnItemEx("BombFlierWarper")
TNT1 A 0 ACS_NamedExecuteAlways("core_rushjetflight",0)
stop
}
}

actor BombFlierCounter : Inventory
{
inventory.amount 1
inventory.maxamount 69 
+AUTOACTIVATE
States
{
Spawn:
TNT1 A 0
stop
}
}

actor BombFlierWarper
{
-SOLID
+NOGRAVITY
+NOINTERACTION
+MISSILE
Scale 2.5
States
{
Spawn:
TNT1 AA 0 A_GiveInventory("ProjectileCode", 1)
TNT1 A 0 ACS_NamedExecuteAlways("core_targetyawpitch", 0, 0)
loopit:
BFLI CCCDDD 1 A_Warp(AAPTR_TARGET, 0,0,0,0,WARPF_NOCHECKPOSITION|WARPF_INTERPOLATE)
TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("core_targetexists",0)==0,"Death")
BFLI D 0 A_TakeInventory("BombFlierCounter", 1, 0, AAPTR_TARGET)
BFLI D 0 A_JumpIFInTargetInventory("GutsManThrowBlockTrigger", 1, "Fire")
BFLI D 0 A_JumpIFInTargetInventory("BombFlierCounter", 1, "loopit")

BFLI CCCDDD 1 A_Warp(AAPTR_TARGET, 0,0,0,0,WARPF_NOCHECKPOSITION|WARPF_INTERPOLATE)
TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("core_targetexists",0)==0,"Death")
BFLI D 0 A_TakeInventory("BombFlierCounter", 1, 0, AAPTR_TARGET)
BFLI D 0 A_JumpIFInTargetInventory("GutsManThrowBlockTrigger", 1, "Fire")
BFLI D 0 A_JumpIFInTargetInventory("BombFlierCounter", 1, "loopit")
Death:
TNT1 A 0 A_TakeFromTarget("BRGAssist",1)
BFLI H 0 A_SpawnItemEx("BombFlierDeath")
TNT1 A 0 A_GiveToTarget("FlyDeactivate",1)
stop
Fire:
BFLI D 0 A_GiveToTarget("TargetMarker", 1)
BFLI D 1 ACS_NamedExecuteAlways("core_aimattargetcursor", 0, CallACS("core_gettarget")+PLN_TARGETPOINT_OFFSET, 32)
BFLI D 0 A_CustomMissile("DiveManTorpedo",16,0,0,2,-pitch)
TNT1 A 0 A_GiveToTarget("FlyDeactivate",1)
stop
}
}

actor BombFlierTeleportStart : AssistTPStart
{
States
{
Death:
TNT1 A 0 A_SpawnItemEx("BombFlierTeleport", 0, 0, 0, 0, 0, -16)
stop
}
}