actor MetalBladeBoss : BaseMM8BDMWep_CBM
{
tag "$TAGC_2A"
dropitem "MetalBladeWepCDropped"
Weapon.AmmoUse 0
Weapon.AmmoGive 28
Obituary "$OB_METALBLADE"
weapon.ammotype "BuzzsawAmmo"
States
{
Spawn:
C_02 A 1
loop
Ready:
BUIN A 0 ACS_ExecuteAlways(998,0,DYE_METALMAN)
BUIN A 0 A_GunFlash
Goto Ready1
Ready1:
BUIN A 2 A_WeaponReady
BUIN A 0 A_GiveInventory("BuzzsawAmmo",2)
loop
Deselect:
BUIN AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
BUIN A 1 A_Lower
Loop
Select:
BUIN AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
BUIN A 1 A_Raise
Loop
Hold:
Fire:
BUIN A 0 A_JumpIfInventory("IsBot",1,"BotFire")
BUIN A 0 A_PlaySound("weapon/metalblade",1,1.0)
BUIN A 0 A_GiveInventory("MetalmanMain_CI",1)
BUIN A 0 A_GiveInventory("PowerMetalFloat",1)
FireEnd:
BUIN BCDEF 2
BUIN A 0 A_GiveInventory("BuzzsawAmmo",1)
BUIN A 0 A_ReFire
Goto Ready1
Altfire:
BUIN D 0 A_JumpIfInventory("IsBot",1,"BotFire0")
BUIN D 0 A_GiveInventory("MetalClimbing",1)
BUIN D 0 A_GiveInventory("BuzzsawAmmo",1)
BUIN A 0 A_PlaySound("weapon/MetalMelee",1,1.0)
BUIN D 3 A_GiveInventory("MetalmanAlt_CI",1)
BUIN D 0 A_Refire("Altfire")
BUIN D 0 A_TakeInventory("VivifyDelay8",9)
goto Ready1

Flash:
TNT1 A 0 A_JumpIfInventory("IsDead",1,"NoFlash")
TNT1 A 1 A_GiveInventory("MetalmanFlashGive_P",1)
loop

BotFire:
BUIN A 0 A_JumpIfInventory("BuzzsawAmmo",56,"BotFire1")
BUIN A 0 A_JumpIfCloser(100,"AltFire")
BUIN A 0 A_Jump(181,2)
BUIN A 0 A_GiveInventory("BotJumpC",1)
BUIN A 0 A_GiveInventory("BotRetreatFlag",1)
BUIN A 0 A_GiveInventory("MetalmanMain_CI",1)
BUIN A 0 A_GiveInventory("PowerMetalFloat",1)
BUIN A 0 A_PlaySound("weapon/metalblade",1,1.0)
BUIN BCDEF 2
BUIN A 0 A_GiveInventory("BuzzsawAmmo",2)
BUIN A 0 A_TakeInventory("BotRetreatFlag",999)
BUIN A 0 A_ReFire
Goto Ready1
BotFire0:
BUIN A 0 A_JumpIfCloser(100,2)
BUIN A 0 A_Jump(8,"BotFire2")
BUIN A 0
goto Altfire+1

BotFire1:
BUIN A 0 A_Jump(196,"BotFire2")
goto BotFire+1
BotFire2:
BUIN D 0 A_PlaySound("weapon/MetalMelee",1,1.0)
BUIN A 0 A_GiveInventory("MetalmanItemBot_P",1)
BUIN D 0 A_TakeInventory("BuzzsawAmmo",56)
BUIN D 0 A_PlaySound("weapon/MetalJump",7,1.0)//SoundSlot7
BUIN A 0 A_Jump(256,1,2,3)
BUIN D 3 A_ChangeVelocity(-Cos(pitch)*36,0,sin(pitch)*18,1)
Goto Ready1
BUIN D 3 A_ChangeVelocity(-Cos(25)*36,0,sin(25)*18,1)
Goto Ready1
BUIN D 3 A_ChangeVelocity(-Cos(75)*36,0,sin(75)*26,3)
Goto Ready1
}
}

actor BuzzsawAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 56
+INVENTORY.IGNORESKILL
}

actor MetalHoverBootsAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 280
+INVENTORY.IGNORESKILL
}

actor MetalFloatFlag : OnceC {}

actor PowerMetalFloat : PowerUp
{
powerup.duration 6
}
actor MetalClimbing : PowerMetalFloat{}

actor PowerMetalFloatSpeed : PowerSpeed
{
Speed 1.65
powerup.duration 3
+POWERSPEED.NOTRAIL
}

actor MetalmanItemBot_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("MetalFloatFlag",1,"Use2")
TNT1 A 0 A_GiveInventory("MetalFloatFlag",1)
stop
Use2:
TNT1 A 0 A_TakeInventory("MetalFloatFlag",1)
stop
}
}

actor MetalmanFlashGive_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_GiveInventory("MetalmanFloat_P",1)
TNT1 A 0 A_JumpIfInventory("MetalClimbing",1,2)
TNT1 A 0 A_JumpIf(z-floorz<1,"Pickup0")
TNT1 A 0
stop
Pickup0:
TNT1 A 0 A_JumpIfInventory("PowerRage_ST",1,"PickupR")
TNT1 A 0 A_GiveInventory("MetalHoverBootsAmmo",1)
stop
PickupR:
TNT1 A 0 A_GiveInventory("MetalHoverBootsAmmo",2)
stop
}
}

actor MetalmanFloat_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("MetalFloatFlag",1,"Pickup0")
TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(C_JAX_CHECK_JUMP)==1,"Pickup0")
stop
Pickup0:
TNT1 A 0 A_JumpIfInventory("FlightDisableFlag",1,"No")
TNT1 A 0 A_JumpIfInventory("PowerMetalFloat",1,"Pickup1")
stop
No:
TNT1 A 0
stop
Pickup1:
TNT1 A 0 A_JumpIfInventory("MetalHoverBootsAmmo",1,"Pickup2")
stop
Pickup2:
TNT1 A 0 A_JumpIf(momz<0,"Pickup3")
stop
Pickup3:
TNT1 A 0 A_GiveInventory("PowerMetalFloatSpeed",1)
TNT1 A 0 A_TakeInventory("MetalHoverBootsAmmo",1)
//TNT1 A 0 ThrustThingZ(0,4,0,0)//A_ChangeVelocity(momx,momy,0,2)
TNT1 A 0 ThrustThingZ(0,12,1,0)
stop
}
}

actor MetalManBlade
{
Translation "199:199=4:4"
PROJECTILE
damagetype "MetalM_Blade"
Obituary "$OB_METALBLADE"
+RIPPER
Damage (140)
Radius 3
Height 4
Speed 40
scale 2.5
States
{
Spawn:
MEGR TU 1
loop
}
}

actor MetalManBladeB : MetalManBlade{translation "199:199=74:74"}
actor MetalManBladeR : MetalManBlade{translation "199:199=41:41"}
actor MetalManBladeO : MetalManBlade{translation "199:199=128:128"}
actor MetalManBladeP : MetalManBlade{translation "199:199=232:232"}

actor MetalManBlade2 : MetalManBlade
{
Translation "199:199=4:4"
-RIPPER
Damage (0)
States
{
Death:
MEGR U 0 A_JumpIf(z-floorz<5, "Floor")
MEGR U 0 A_JumpIf(z-ceilingz==0-4, "Ceiling")
//MEGR U 0 A_SpawnItemEx("MetalManBladeW")
stop
Floor:
MEGR U 0 A_SpawnItemEx("MetalManBladeF",0,0,0,30,0,0,0,1)
stop
Ceiling:
MEGR U 0 A_SpawnItemEx("MetalManBladeC",0,0,0,0,0,0,0,1)
MEGR U 0 A_SpawnItemEx("MetalManBladeC2",0,0,0,0,0,0,0,1)
stop
XDeath:
MEGR U 0
stop
}
}

actor MetalManBlade2B : MetalManBlade2{translation "199:199=74:74"}
actor MetalManBlade2R : MetalManBlade2{translation "199:199=41:41"}
actor MetalManBlade2O : MetalManBlade2{translation "199:199=128:128"}
actor MetalManBlade2P : MetalManBlade2{translation "199:199=232:232"}

actor MetalManBladeF : MetalManBlade
{
-NOGRAVITY
Speed 30
States
{
Spawn:
MEGR T 1
MEGR T 0 A_GiveInventory("Once",1)
MEGR UT 1 //A_Recoil(-2)
goto Spawn+2
Death:
TNT1 A 0 A_JumpIfInventory("Once",1,"Continue")
TNT1 A 1
stop
Continue:
//TNT1 A 0 A_CustomMissile("MetalManBladeF",0,0,0,2,0)
TNT1 A 0 A_SpawnItemEx("MetalManBladeF",0,0,0,30,0,0,0,1)
TNT1 A 1
stop
}
}

actor MetalManBladeW : MetalManBlade
{
+NOGRAVITY
Speed 0
States
{
Spawn:
MEGR TU 1 ThrustThingZ(0,7,0,0)
loop
}
}

actor MetalManBladeC : MetalManBlade
{
-NOGRAVITY
Speed 0
}

actor MetalManBladeC2 : MetalManBladeC
{
-RIPPER
Damage (0)
States
{
Death:
MEGR U 0 A_JumpIf(z-floorz<5, "Floor")
stop
Floor:
MEGR U 0 A_SpawnItemEx("MetalManBladeF",0,0,0,30,0,0,0,1)
stop
XDeath:
MEGR U 0
stop
}
}

actor MetalManChainBlade
{
Translation "199:199=4:4"
PROJECTILE
Damagetype "MetalM_Chain" 
Obituary "$OB_METALBLADE"
+RIPPER
+DONTBLAST
+DONTREFLECT
Damage (60)
Radius 3
Height 4
Speed 64
scale 2.5
States
{
Spawn:
MEGR TU 1
stop
Death:
TNT1 A 0 A_GiveToTarget("MetalManClimb_P",1)
stop
XDeath:
Crash:
TNT1 A 1
stop
}
}

actor MetalManChainBladeB : MetalManChainBlade{translation "199:199=74:74"}
actor MetalManChainBladeR : MetalManChainBlade{translation "199:199=41:41"}
actor MetalManChainBladeO : MetalManChainBlade{translation "199:199=128:128"}
actor MetalManChainBladeP : MetalManChainBlade{translation "199:199=232:232"}

actor MetalManClimb_P : CustomInventory
{
states
{
Pickup:
TNT1 A 0
TNT1 A 0 A_JumpIfInventory("FlightDisableFlag",1,"No")
TNT1 A 0 A_JumpIfInventory("MetalHoverBootsAmmo",1,"Success")
TNT1 A 0 A_JumpIfInventory("VivifyDelay8",1,5)
stop
Success:
TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(C_JAX_CHECK_JUMP)==1,"SuccessChain")
TNT1 A 0 A_JumpIfInventory("VivifyDelay8",1,3)
TNT1 A 0 A_TakeInventory("MetalHoverBootsAmmo",5)
TNT1 A 0 A_GiveInventory("VivifyDelay8",1)
TNT1 A 0 A_PlaySound("weapon/MetalMelee2",4,0.35)
TNT1 A 0 A_JumpIfInventory("PowerRage_ST",1,"Success_R")
TNT1 A 0 ThrustThingZ(0,30,0,0)//16
stop
Success_R:
TNT1 A 0 ThrustThingZ(0,54,0,0)//28
stop
SuccessChain:
TNT1 A 0 A_JumpIfInventory("BuzzsawAmmo",56,"SuccessChainBoost")
stop
SuccessChainBoost:
TNT1 A 0 A_TakeInventory("MetalHoverBootsAmmo",25)
TNT1 A 0 A_TakeInventory("BuzzsawAmmo",56,1)
TNT1 A 0 A_PlaySound("weapon/MetalJump",7,1.0)//SoundSlot7
TNT1 A 0 A_ChangeVelocity(-Cos(pitch)*36, 0, sin(pitch)*18,1)
stop
No:
TNT1 A 0
stop
}
}

actor MetalmanMain_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("MetalManBlade",0,1,8,0)
TNT1 A 0 A_FireCustomMissile("MetalManBlade2",0,0,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("MetalManBladeB",0,1,8,0)
TNT1 A 0 A_FireCustomMissile("MetalManBlade2B",0,0,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("MetalManBladeR",0,1,8,0)
TNT1 A 0 A_FireCustomMissile("MetalManBlade2R",0,0,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("MetalManBladeO",0,1,8,0)
TNT1 A 0 A_FireCustomMissile("MetalManBlade2O",0,0,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("MetalManBladeP",0,1,8,0)
TNT1 A 0 A_FireCustomMissile("MetalManBlade2P",0,0,8,0)
goto Done
}
}

actor MetalmanAlt_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("MetalManChainBlade",0,1,0,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("MetalManChainBladeB",0,1,0,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("MetalManChainBladeR",0,1,0,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("MetalManChainBladeO",0,1,0,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("MetalManChainBladeP",0,1,0,0)
goto Done
}
}


