actor JetAdaptorWep_NormalBar : NormalBar {Args 4,42}//176
//actor JetAdaptorWep_ScriptBar : ScriptBar {}

actor JetAdaptorWep : BaseMM8BDMWep 
{
tag "$TAG_JETADAPTOR"
dropitem "JetAdaptorUpgrade"
Weapon.AmmoUse 0
Weapon.AmmoGive 0
Weapon.SlotNumber 1
Obituary "$OB_JETADAPTOR"
weapon.ammotype "JetMeter"
inventory.icon "NULLICON"
States
{
SpawnLoop:
JETB Z 1
stop

Deselect:
JETB A 0
goto DeselectSwap
Select:
JETB A 0
goto SelectSwap

Ready:
JETB A 0 A_JumpIfInventory("BusterGiven",1,"TakeBusters")
Goto Ready1
TakeBusters:
JETB A 0 A_GiveInventory("TakeBuster",1)
Goto Ready1
Ready1:
JETB A 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_POWERFLIGHT)
JETB A 0 A_SpawnItemEx("JetAdaptorWings",-12,0,36)
goto Ready3
Ready3:
JETB A 1 A_WeaponReady
wait


Altfire:
Fire:
JETB C 0 A_PlaySoundEx("weapon/mbuster","Weapon")
JETB C 3 A_FireCustomMissile("JetAdaptorShot",0,0,8,0)
JETB C 0 A_PlaySoundEx("weapon/mbuster","Weapon")
JETB C 3 A_FireCustomMissile("JetAdaptorShot",random(-4,-1),0,8,0)
JETB C 0 A_PlaySoundEx("weapon/mbuster","Weapon")
JETB C 3 A_FireCustomMissile("JetAdaptorShot",random(1,4),0,8,0)
JETB B 9
JETB A 3
JETB A 0 A_Refire
goto Ready3

}
}

actor JetMeter : Ammo
{
inventory.amount 1
inventory.maxamount 140
+INVENTORY.IGNORESKILL
}

actor JetAdaptor_F : Inventory{}

actor JetAdaptorUpgrade : BaseMM8BDMBusterUpgrade
{
Inventory.RespawnTics 350
inventory.pickupmessage "$PU_JETADAPTOR"
Tag "$TAG_JETADAPTORUPGRADE"
inventory.icon "JETUP"
Inventory.PickupSound "item/1up"
scale 2.0
+COUNTITEM
+INVBAR
states
{
SpawnLoop:
UPGR A 1
loop
Use:
TNT1 A 0 A_PlaySoundEx("item/refill","Voice")
TNT1 A 0 A_JumpIfInventory("IsMegaman_F",1,"MegaUse")
TNT1 A 0 A_GiveInventory("BusterGiven",1)
TNT1 A 0 A_GiveInventory("JetMeter",140)
TNT1 A 0 A_GiveInventory("JetAdaptorWep",1)
TNT1 A 0 A_SelectWeapon("JetAdaptorWep")
goto ACS
MegaUse:
TNT1 A 0 A_SpawnItemEx("HeroMegaman_H1")
//TNT1 A 0 A_GiveInventory("Megaman_W1",1)
//TNT1 A 0 A_SelectWeapon("Megaman_W1")
stop//goto ACS
ACS:
TNT1 A 0 ACS_NamedExecuteWithResult("cbm_jetadaptor",0)
stop
}
}
actor JetAdaptorUpgrade_Respawn : 8BDMItemRespawn{Translation "192:198=4:42" mass 350}
actor JetAdaptorUpgrade_RespawnShadow : 8BDMItemRespawnShadow
{
mass 350
States
{
Spawn:
UPGR A 0
//JETB Z 0
goto Super::Spawn
}
}

actor JetAdaptorShot : ProjSpawnFuncActorFast
{
PROJECTILE
Damagetype "MegaM_JetShot"
Obituary "$OB_JETADAPTOR"
+FORCEXYBILLBOARD
+BRIGHT
Damage (70)
radius 10
height 5
Speed 70
scale 2.5
States
{
Spawn:
TNT1 A 0 
TNT1 A 1
MMJT D 1
wait
Death:
MMJT EFG 2
stop
}
}


actor JetAdaptorWings : BaseShieldWarper
{
Translation "192:192=4:4","198:198=42:42"
States
{
Spawn:
TNT1 A 0
TNT1 A 0 ACS_NamedExecuteAlways("core_shieldwarper", 0, 1)
TNT1 A 0 A_Jump(256, "Shield")
Goto Shield
Shield:
MMJT A 0 A_JumpIfInTargetInventory("JetBoostPower",1,"Shield2Start")
MMJT A 0 ACS_NamedExecuteWithResult("core_copytranslation_client",0)
MMJT A 1 A_Warp(AAPTR_TARGET,-12,0,36,0,WARPF_NOCHECKPOSITION|WARPF_COPYINTERPOLATION)//8+64
loop
Shield2Start:
TNT1 A 0 A_PlaySound("misc/gutsgboost")
Shield2:
TNT1 A 0 A_SpawnItemEx("BoosterFX",0,-15,-12,0,-2,-10,0)
TNT1 A 0 A_SpawnItemEx("BoosterFX",0, 15,-12,0, 2,-10,0)
MMJT A 0 ACS_NamedExecuteWithResult("core_copytranslation_client",0)
MMJT BB 1 A_Warp(2,-12,0,36,0,8+64)
MMJT A 0 A_JumpIfInTargetInventory("JetBoostPower",1,"Shield2")
goto Shield
}
}

actor JetBoostPower : Powerup
{
Powerup.Duration 10
}

actor JetAdaptor_Ammo_P : CustomInventory//ACS Given
{
States
{
Pickup:
TNT1 A 0 A_GiveInventory("JetMeter",2+CallACS("core_checkrune",RUNE_RAGE,0)*2)
stop
}
}

actor JetAdaptorBoosting_P : CustomInventory//ACS Given
{
States
{
Pickup:
TNT1 A 0 A_TakeInventory("JetMeter",1)
TNT1 A 0 A_TakeInventory("JetMeter",1,1)
TNT1 A 0 A_JumpIfInventory("PlayerPropertyGrounded",1,"Simple")
TNT1 A 0 A_JumpIf(momz>=0,"Simple")
TNT1 A 0 A_JumpIfInventory("BoostFlag",1,4)
TNT1 A 0 A_JumpIfInventory("JetBoostPower",1,3)
TNT1 A 0 A_TakeInventory("JetMeter",4)
TNT1 A 0 A_TakeInventory("JetMeter",4,1)
TNT1 A 0 ThrustThingZ(0,5,0,0)
Simple:
TNT1 A 0 A_TakeInventory("BoostFlag",1)
TNT1 A 0 A_GiveInventory("JetBoostPower",1)
TNT1 A 0 ThrustThingZ(0,4,0,1)
stop
}
}

