actor MetalBladeBoss : BaseMM8BDMWep_CBM
{
Tag "$TAGC_2A"
dropitem "MetalBladeWepCDropped"
Weapon.AmmoUse 0
Weapon.AmmoGive 28
Obituary "$OB_METALBLADE"
weapon.ammotype "BuzzsawAmmo"
weapon.ammotype2 "MetalHoverBootsAmmo"
+WEAPON.NOAUTOAIM
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 1 A_WeaponReady
BUIN A 0 A_CheckFloor("Ready2")
loop
Ready2:
BUIN A 5 A_WeaponReady
BUIN A 0 A_GiveInventory("BuzzsawAmmo",2)
loop

Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
BUIN A 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
BUIN A 1 A_Raise
Loop
Hold:
Fire:
BUIN A 0 A_JumpIfInventory("IsBot",1,"BotFire")
BUIN A 0 A_JumpIfInventory("BuzzsawAmmo",1,"FireX")
goto FireN
FireX:
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 A 0 A_TakeInventory("BuzzsawAmmo",2)
BUIN B 1
BUIN B 2 OffSet(-70,72)
BUIN B 1 OffSet(-121,112)
BUIN F 2 OffSet(1,33)
BUIN F 1 OffSet(-21,56)
BUIN F 1 OffSet(-35,84)
TNT1 A 0 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
BUIN A 1 OffSet(0,69)
BUIN A 1 OffSet(0,48)
BUIN A 0 A_ReFire
Goto Ready1
FireN:
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)
FireEndN:
BUIN A 0 A_TakeInventory("BuzzsawAmmo",2)
BUIN B 1
BUIN B 1 OffSet(-70,72)
BUIN B 1 OffSet(-121,112)
BUIN F 2 OffSet(1,33)
BUIN F 2 OffSet(-21,56)
BUIN F 2 OffSet(-35,84)
TNT1 A 3
BUIN A 2 OffSet(2,69)
BUIN A 2 OffSet(1,48)
BUIN A 2 A_WeaponReady(14)
BUIN A 0 A_ReFire
Goto Ready1
Altfire:
BUIN D 0 A_GiveInventory("Climbing",1)
BUIN D 0// A_GiveInventory("BuzzsawAmmo",1)
BUIN A 0 A_PlaySound("weapon/MetalMelee",1,1.0)
BUIN J 2 Offset(-56,10)A_GiveInventory("MetalmanAlt_CI",1)
BUIN Z 2 Offset(-56,9)A_GiveInventory("MetalmanAlt_CI",1)
BUIN D 0 A_TakeInventory("Climbing",9)
BUIN D 0 A_Refire
goto Ready1

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

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
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)
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 10
}
actor PowerMetalFloatSpeed : PowerSpeed
{
Speed 1.65
powerup.duration 3
+POWERSPEED.NOTRAIL
}

actor MetalmanItem : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
inventory.icon "MetlIcon"
Tag "$TAGC_2A2"
inventory.pickupmessage "I gotta buzz off!"
scale 2.0
+INVBAR
states
{
Spawn:
MEGR Z 1
wait
Use:
TNT1 A 0 A_PlaySoundEx("item/ItemUseMM9","SoundSlot6")
TNT1 A 0 A_JumpIfInventory("MetalFloatFlag",1,"Use2")
TNT1 A 0 A_GiveInventory("MetalFloatFlag",1)
fail
Use2:
TNT1 A 0 A_TakeInventory("MetalFloatFlag",1)
fail
}
}
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("Climbing",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("BuzzsawAmmo",2,"PickupX")
stop
PickupX:
TNT1 A 0 A_JumpIfInventory("MetalFloatFlag",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_JumpIf(momz<0,"Pickup2")
stop
Pickup2:
TNT1 A 0 A_GiveInventory("PowerMetalFloatSpeed",1)
TNT1 A 0 A_ChangeVelocity(momx,momy,momz/2,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 (12)
Radius 5
Height 15
Speed 40
scale 2.5
reactiontime 350
States
{
Spawn:
TNT1 A 0
TNT1 A 0 ACS_NamedExecuteAlways("BULL_Tidifier", 0)
SpawnLOOP:
MEGR TU 1 A_Countdown
loop
Death:
MEGR U 0 A_JumpIf(z-floorz<5, "Floor")
MEGR U 0 A_JumpIf(z-ceilingz==0-15, "Ceiling")
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)
stop
}
}

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 MetalManBladeF : MetalManBlade
{
-NOGRAVITY
+STEPMISSILE
+NOEXPLODEFLOOR
Speed 30
States
{
Spawn:
TNT1 A 0
TNT1 A 0 ACS_NamedExecuteAlways("BULL_Tidifier", 0)
SpawnLOOPFX:
TNT1 A 0 A_PlaySound("weapon/MetalMelee2",4,0.25)
TNT1 A 0 A_SpawnItemEx("WheelCutterClimbFX", 0, frandom(2,3), 0, 5, 0, frandom(1,2), 180+frandom(-8, 8))
SpawnLOOP:
MEGR TU 1
Y_AG C 0 A_JumpIf(momx * momx + momy * momy + momz* momz <= 5, "Death")
TNT1 A 0 A_JumpIf(z-floorz==0,"SpawnLOOPFX")
goto SpawnLOOP
Death:
TNT1 A 1
stop
}
}

actor MetalManBladeC : MetalManBlade
{
-NOGRAVITY
Speed 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_CHAINBLADE"
+DONTBLAST
+RIPPER
+DONTREFLECT
Damage (5)
Radius 3
Height 4
Speed 64
scale 2.5
States
{
Spawn:
MEGR TU 1
stop
Death:
TNT1 A 0 A_GiveToTarget("MetalManClimb_P",1)
TNT1 A 0 A_SpawnItemEx("WheelCutterClimbFX", 16, 0, frandom(0, 16), 5, 0, 1, 180+frandom(-8, 8))
TNT1 A 5 
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")
stop
Success:
TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("Get_Button_M") == 1, "SuccessChain")
TNT1 A 0 //A_JumpIf(ACS_ExecuteWithResult(C_JAX_CHECK_JUMP)==1,"SuccessChain")
TNT1 A 0 A_PlaySound("weapon/MetalMelee2",4,0.35)
TNT1 A 0 A_TakeInventory("MetalHoverBootsAmmo",2)
TNT1 A 0 A_JumpIfInventory("PowerRage_ST",1,"Success_R")
//TNT1 A 0 SetPlayerProperty(0,1,3)
TNT1 A 0 ThrustThingZ(0,30,0,0)
stop
Success_R:
TNT1 A 0 ThrustThingZ(0,54,0,0)//28
stop
SuccessChain:
TNT1 A 0 A_JumpIfInventory("MetalHoverBootsAmmo",140,"SuccessChainBoost")
stop
SuccessChainBoost:
TNT1 A 0 A_JumpIfInventory("MetalDelay", 1, "No")
TNT1 A 0 A_GiveInventory("MetalDelay", 1)
TNT1 A 0 A_TakeInventory("MetalHoverBootsAmmo",140)
TNT1 A 0 A_GiveInventory("MetalHoverBootsAmmo",10)
TNT1 A 0 //A_TakeInventory("BuzzsawAmmo",14)
TNT1 A 0 A_PlaySound("weapon/MetalJump",7,1.0)
TNT1 A 0 A_ChangeVelocity(-Cos(pitch)*36, 0, sin(pitch)*18,1)
stop
No:
TNT1 A 0
stop
}
}

actor MetalDelay : Powerup {powerup.duration 20}

actor MetalmanMain_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("MetalManBlade",0,1,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("MetalManBladeB",0,1,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("MetalManBladeR",0,1,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("MetalManBladeO",0,1,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("MetalManBladeP",0,1,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
}
}
