actor DelayFlameWep_NormalBar : NormalBar {args 64, 62}

actor DelayFlameWep : BaseMM8BDMWep
{
    //$Category RNC-Weapons
    //$Title Delay Flame
    //$Sprite RNCWA0
    Weapon.AmmoUse 1
    Weapon.AmmoGive 56
    Weapon.SlotNumber 3
    Tag "$TAG_DELAYFLAME"
    Obituary "$OB_DELAYFLAME"
    Inventory.Pickupmessage "$PU_DELAYFLAME"
    weapon.ammotype "DelayFlameAmmo"
    inventory.icon "RNCWP1"
    States
    {
        SpawnLoop:
            RNCW A -1
            loop

        Ready:
            NCH1 D 0 ACS_NamedExecuteWithResult("core_weaponcolor",CLR_DELAYFLAME)
            NCH1 D 1 A_WeaponReady
            goto Ready+1

        Deselect:
            NCH1 D 0
            goto DeselectSwap
        Select:
            NCH1 D 0
            goto SelectSwap

        Fire:
            NCH1 D 0 A_JumpIfNoAmmo("NoAmmo")
            NCH1 D 0 A_PlaySoundEx("weapon/atomicfire","Weapon")
            NCH1 D 0 A_FireCustomMissile("DelayFlame",0,1,8,-3)
            NCH1 EF 3
            NCH1 D 2
            NCH1 D 0 A_Refire
            goto Ready+1
            
        NoAmmo:
            NCH1 D 1 ACS_NamedExecute("core_noammo",0)
            goto Ready+1
    }
}

actor DelayFlameAmmo : Ammo {inventory.amount 1 inventory.maxamount 56}

actor DelayFlame : BasicProjectile
{
    +DONTBLAST
    damagetype "DelayFlame"
    Obituary "$OB_DELAYFLAME"
    Speed 10
    Radius 24
    Height 12
    damage (CallACS("rnc_cbm_damage",20))
    States
    {
        Spawn:
            TNT1 A 0
            TNT1 A 0 ACS_NamedExecuteAlways("core_targetyawpitch", 0, 0)
            RNCP AB 3	
            RNCP A 0 A_Stop
            RNCP A 3 ThrustThingZ(0,2,0,1)
            RNCP B 3 A_Stop
            RNCP A 3 ThrustThingZ(0,2,0,1)
            RNCP B 3 A_Stop
            RNCP A 3 ThrustThingZ(0,2,0,1)
            RNCP B 3 A_Stop
            RNCP A 3 ThrustThingZ(0,2,0,1)
            RNCP B 3 A_Stop
            RNCP A 3 ThrustThingZ(0,2,0,1)
            RNCP B 3 A_Stop
            RNCP A 3 ThrustThingZ(0,2,0,1)
            RNCP B 3 A_Stop
            RNCP A 3 ThrustThingZ(0,2,0,1)
            RNCP B 3 A_Stop
            RNCP A 3 ThrustThingZ(0,2,0,1)
            RNCP B 3 A_Stop
        Moving:
            RNCP AB 3 A_ChangeVelocity(Cos(pitch)*30,0,sin(-pitch)*30,CVF_RELATIVE)
            RNCP AB 3
            RNCP A 0 A_SpawnItemEx("DelayFlame2",0,0,0,momx,momy,momz,0,SXF_ABSOLUTEMOMENTUM,0)
            stop
        Death:
            TNT1 A 0
            TNT1 A 0 A_SpawnItemEx("OilPitIgnite",0,0,8)
            stop
    }
}

actor DelayFlame2 : DelayFlame
{
    States
    {
        Spawn:
            RNCP A 0
            RNCP AB 3
            loop
    }
}