actor DuoMeteorWepC : BaseMM8BDMWep_CBM
{
dropitem "DuoFistUpgrade2Dropped"
Weapon.AmmoUse 1
Weapon.AmmoGive 3
Weapon.SlotNumber 1
Obituary "$OB_DUOMETEOR"
Inventory.Pickupmessage "You got the Duo Meteor!"
weapon.ammotype "DuoGetReadyAmmo"
States
{
Spawn:
C_08 I 1
loop
Ready:
TNT1 A 0 ACS_ExecuteAlways(998,0,706)
goto Fire
Deselect:
//TNT1 A 0 A_TakeInventory("DuoMeteorWepC",1)
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
TNT1 A 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
TNT1 A 1 A_Raise
Loop
Fire:
TNT1 A 0 A_TakeInventory("DuoMeteorGo",1)
TNT1 A 0 A_TakeInventory("DuoMeteorEnd",1)
TNT1 A 0 A_GiveInventory("DuoMeteor",1)
TNT1 A 0 A_TakeInventory("DuoMeteorTimer",999)
TNT1 A 0 A_Stop
TNT1 A 0 SetPlayerProperty(0,1,0)
TNT1 A 0 A_PlaySoundEx("weapon/pcharge","Weapon")

Rise:
TNT1 A 0 A_GiveInventory ("DuoMeteorTimer",1)
TNT1 A 0 A_JumpIfInventory("FlightDisableFlag",1,2)
TNT1 A 0 ThrustThingZ(0,10,0,0)
TNT1 A 1
TNT1 A 0 A_JumpIfInventory("DuoMeteorTimer",20,"BallStart")
loop

BallStart:
TNT1 A 0 A_TakeInventory ("DuoMeteorTimer",999)
TNT1 A 0 A_GiveInventory("DuoMeteorGo",1)
TNT1 A 0 A_GiveInventory("IsInvunFlag",1)
DUOR A 0 A_ChangeFlag("INVULNERABLE",1)

BallStart2:
TNT1 A 0 A_GiveInventory ("DuoMeteorTimer",1)
TNT1 A 0 A_JumpIfInventory("FlightDisableFlag",1,2)
TNT1 A 0 ThrustThingZ(0,0,0,0)
TNT1 A 1
TNT1 A 0 A_JumpIfInventory("DuoMeteorTimer",4,"Ball")
loop

Ball:
TNT1 A 0 A_TakeInventory("DuoMeteorTimer",999)
TNT1 A 0 A_GiveInventory("SelfTotallyFrozen",1)

Ball2:
TNT1 A 0 A_ChangeVelocity(cos(pitch)*40,0,-sin(pitch)*40,3)
//GigaFistFXLefty
TNT1 A 0 A_SpawnItemEX("DuoMeteorMotionCheck",0,0,0,0,0,0)
TNT1 A 1 A_SpawnItemEX("DuoMeteorCollideCheck",0,0,0,momx,momy,momz,0,8,0)
TNT1 A 0 A_JumpIfInventory ("DuoMeteorEnd",1,"Collide")
TNT1 A 0 A_GiveInventory ("DuoMeteorTimer",1)
TNT1 A 0 A_JumpIfInventory ("DuoMeteorTimer",45,"TimeOut")
loop

TimeOut:
TNT1 A 0 A_GiveInventory("DuoMeteorEnd",1)
//TNT1 A 0 A_Stop
goto Fall

Collide:
TNT1 A 0 A_PlaySoundEx("weapon/blizzstrike","Weapon")
TNT1 A 0 A_FireCustomMissile("DuoMeteorCollide",0,0,0,0)
//TNT1 A 0 A_Stop
TNT1 A 0 ThrustThingZ(0,60,0,0)
//TNT1 A 0 A_Recoil(5)
Fall:
TNT1 A 0 A_GiveInventory("SelfTotallyUnfrozen",1)
TNT1 A 0 SetPlayerProperty(0,0,0)
TNT1 A 0 A_TakeInventory("IsInvunFlag",1)
DUOR A 0 A_ChangeFlag("INVULNERABLE",0)

TNT1 A 25

GoAway:
TNT1 A 0 A_TakeInventory("DuoMeteorWepC",1)
TNT1 A 1
loop

}
}

actor DuoGetReadyAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 3
+INVENTORY.IGNORESKILL
}

actor DuoMeteorItem : CustomInventory
{
inventory.amount 1
inventory.maxamount 2
inventory.icon "DUOHAND"
inventory.pickupmessage "Support Item! Duo Meteor!"
Inventory.PickupSound "item/1up"
scale 2.0
+COUNTITEM
+INVBAR
states
{
Spawn:
DUOF A 1
loop
Use:
TNT1 A 0 A_JumpIfInventory("DuoMeteorWepc",1,"No")
TNT1 A 0 A_PlaySoundEx("item/refill","Voice")
TNT1 A 0 A_GiveInventory("DuoMeteorActivate",1)
stop
No:
TNT1 A 0
fail
}
}

actor DuoMeteorActivate : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_GiveInventory("DuoMeteorWepC",1)
TNT1 A 0 A_SelectWeapon("DuoMeteorWepC")
stop
}
}


actor DuoMeteor : Inventory
{
inventory.amount 1
inventory.maxamount 1
}
actor DuoMeteorGo : DuoMeteor {}
actor DuoMeteorEnd : DuoMeteor {}
actor DuoMeteorTimer : DuoMeteor
{
inventory.maxamount 999
}

actor DuoMeteorMotionCheck
{
Height 0
Radius 0
+NOINTERACTION
-SOLID
+NOGRAVITY
+MISSILE
States
{
Spawn:
TNT1 A 0
TNT1 A 2
TNT1 A 1 A_JumpIfCloser(40,"Stopped")
stop
Stopped:
TNT1 A 1 A_GiveToTarget("DuoMeteorTimer",999)
stop
}
}

actor DuoMeteorCollideCheck
{
PROJECTILE
+DONTBLAST
+DONTREFLECT
+NOGRAVITY
Radius 40
Height 60
damage 0
States
{
Spawn:
TNT1 A 0
TNT1 A 1
stop
Death:
TNT1 A 0 A_GiveToTarget("DuoMeteorEnd",1)
Stop
}
}

actor DuoMeteorCollide : BasicExplosion
{
damagetype "DuoRam"
Obituary "$OB_DUOMETEOR"
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Explode(25,150,0,0,16)
stop
}
}