actor GyroAttackWep : BaseMM8BDMWep 10059
{
//$Category MM8BDM-Weapons
//$Title Gyro Attack
//$Sprite WEA2I0
Weapon.AmmoUse 4
Weapon.AmmoGive 28
Weapon.SlotNumber 2
Inventory.Pickupmessage "$PU_GYROATTACK"
Obituary "$OB_GYROATTACK"
Tag "$TAG_GYROATTACK"
weapon.ammotype "GyroAttackAmmo"
inventory.icon "GYROSI"
States
{
SpawnLoop:
WEA2 I -1
loop
Ready:
LEAF A 0 ACS_ExecuteAlways(998,0,28)
LEAF A 1 A_WeaponReady
Goto Ready+1
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
LEAF A 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
LEAF A 1 A_Raise
Loop
Fire:
LEAF A 0 A_JumpIfNoAmmo("NoAmmo")
LEAF A 2 
LEAF A 0 A_PlaySoundEx("weapon/mbuster","Weapon")
LEAF J 3
LEAF J 0 A_SpawnItemEx("GyroBoomerangWarper")
LEAF J 0 A_GiveInventory("ShieldCheck", 1)
LEAF J 0 A_GiveInventory("GyroBoomerangCheck", 28)
LEAF J 0 A_JumpIfInventory("IsBot", 1, "BotCheck")
Goto Hold
Hold:
LEAF K 0 A_JumpIfInventory("GyroBoomerangCheck", 1, "HoldLoop")
goto AltHold
HoldLoop:
LEAF K 1 A_RailWait
LEAF K 0 A_TakeInventory("GyroBoomerangCheck", 1)
LEAF K 1 A_SpawnItemEx("GyroBoomerangDamager",0,0,0,0,0,0)
LEAF K 0 A_PlaySoundEx("weapon/gyroattack","Body")
LEAF K 1 A_GiveInventory("GyroBlowThrust",1)
LEAF K 0 A_Refire("Hold")
AltHold:
LEAF J 0 A_ClearRefire
LEAF K 0 A_TakeInventory("GyroBoomerangCheck",999)
LEAF J 0 A_TakeInventory("ShieldCheck",999)
LEAF J 2 A_GiveInventory("GyroFlag",2)
LEAF J 0 A_TakeInventory("GyroFlag",999)
Altfire:
LEAF A 0 A_JumpIfNoAmmo("NoAmmo")
LEAF A 0 A_FireCustomMissile("GyroAttack",0,0,8,0)
LEAF A 0 A_TakeInventory("GyroAttackAmmo",4)
BOMH BCDEFG 2
LEAF A 9
Goto Ready+1
BotCheck:
LEAF D 5 A_RailWait
LEAF D 0 A_Jump(128, "BotCheck")
Goto Hold+2

NoAmmo:
LEAF A 1 ACS_Execute(979,0)
Goto Ready+1
}
}

actor GyroBoomerangWarper : BaseShieldWarper
{
Scale 5.5
	+BRIGHT
	States
	{
	Shield:
	GYRO A 1 
	GYRO ABBCCDDAABBCCDD 1 A_Warp(AAPTR_TARGET, -2, 0, 64, 0, WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
	loop
	}
}

actor GyroBoomerangCheck : Inventory
{
inventory.amount 1
inventory.maxamount 28
}

actor GyroBoomerangDamager
{
PROJECTILE
damagetype "GyroAttack"
Obituary "$OB_GYROBOOMERANG"
+RIPPER
+DONTBLAST
damage (1)
radius 160
height 32
States
{
Spawn:
TNT1 A 1 
stop
}
}

actor GyroBoomerangDamager2
{
PROJECTILE
damagetype "GyroAttack"
Obituary "$OB_GYROATTACK"
+RIPPER
+DONTBLAST
damage (6)
Radius 20
Height 16
States
{
Spawn:
TNT1 A 1 
stop
}
}

actor GyroAttack
{
PROJECTILE
Radius 20
Height 16
scale 3.5
damage (6)
damagetype "GyroAttack"
Obituary "$OB_GYROATTACK"
speed 30
+NOEXPLODEFLOOR
+RIPPER
States
{
Spawn:
GYRO A 0
GYRO A 0 A_PlaySoundEx("weapon/gyroattack","Auto")
GYRO AABBCCDDAABBCCDD 1 ThrustThingZ(0,2,0,1)
loop
Death:
GYRO A 1 A_CustomMissile("GyroAttackReturner",0,0,0,0)
stop
}
}

actor GyroAttack2 : GyroAttack
{
+SEEKERMISSILE
+NOINTERACTION
States
{
Spawn:
GYRO A 0 A_FaceTarget
GYRO A 0 A_SeekerMissile(90,90,SMF_PRECISE)
GYRO A 0 A_PlaySoundEx("weapon/gyroattack","Auto")
GYRO A 1 A_SpawnItemEx("GyroBoomerangDamager2",0,0,0,2,0,0)
GYRO A 1 A_JumpIfCloser(64,"Death")
GYRO B 1 A_SpawnItemEx("GyroBoomerangDamager2",0,0,0,2,0,0)
GYRO B 1 A_JumpIfCloser(64,"Death")
GYRO C 1 A_SpawnItemEx("GyroBoomerangDamager2",0,0,0,2,0,0)
GYRO C 1 A_JumpIfCloser(64,"Death")
GYRO D 1 A_SpawnItemEx("GyroBoomerangDamager2",0,0,0,2,0,0)
GYRO D 1 A_JumpIfCloser(64,"Death")
GYRO A 1 A_SpawnItemEx("GyroBoomerangDamager2",0,0,0,2,0,0)
GYRO A 1 A_JumpIfCloser(64,"Death")
GYRO B 1 A_SpawnItemEx("GyroBoomerangDamager2",0,0,0,2,0,0)
GYRO B 1 A_JumpIfCloser(64,"Death")
GYRO C 1 A_SpawnItemEx("GyroBoomerangDamager2",0,0,0,2,0,0)
GYRO C 1 A_JumpIfCloser(64,"Death")
GYRO D 1 A_SpawnItemEx("GyroBoomerangDamager2",0,0,0,2,0,0)
GYRO D 1 A_JumpIfCloser(64,"Death")
loop
Death:
GYRO A 1 
stop
XDeath:
GYRO A 1
stop
}
}

actor GyroAttackReturner : GyroAttack2
{
+SEEKERMISSILE
States
{
Spawn:
GYRO A 0
TNT1 A 0
SpawnLOOP:
GYRO A 0 A_RearrangePointers(0,0,2)
GYRO A 0 A_FaceTarget(0,0)
GYRO A 0 A_ChangeVelocity(Cos(pitch)*40,0,sin(pitch)*40,3)
GYRO AA 0 A_SeekerMissile(90,90,SMF_PRECISE)
goto Super::Spawn
Death:
goto XDeath
}
}

actor GyroFlag : Inventory
{
inventory.amount 1
inventory.maxamount 2
}

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

actor GyroBlowThrust : CustomInventory
{
States
{
Pickup:
TNT1 A 0
TNT1 A 0 A_JumpIf(z-floorz<5, "End")
TNT1 A 0 ThrustThingZ(0, 21, 0, 0)
stop
End:
TNT1 A 0
stop
}
}