actor MetalBladeBoss : BaseMM8BDMWep_CBM
{
dropitem "MetalBladeWepCDropped"
Weapon.AmmoUse 0
Weapon.AmmoGive 28
Weapon.SlotNumber 1
Obituary "$OB_METALBLADE"
weapon.ammotype "MootalAmmo"
States
{
Spawn:
C_02 A 1
loop
Ready:
BUIN A 0 ACS_ExecuteAlways(998,0,740)
BUIN A 0 A_GunFlash
BUIN A 0 A_TakeInventory("Climbing",1)
BUIN A 10 A_WeaponReady
//BUIN A 0 A_GiveInventory("MootalAmmo",2)
Goto Ready+2
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_PlaySound("weapon/metalblade",1,1.0)
BUIN A 0 A_GiveInventory("MetalmanMain_CI",1)
FireEnd:
BUIN BCDEF 2
BUIN A 0 A_ReFire
Goto Ready+2
Altfire:
SNAB A 0 A_GiveInventory("Climbing",1)
BUIN A 0 A_PlayWeaponSound("weapon/MetalMelee")
BUIN D 3 A_GiveInventory("MetalmanAlt_CI",1)
goto Ready+3
Flash:
TNT1 A 0 A_JumpIfInventory("IsDead",1,"NoFlash")
TNT1 A 0 A_JumpIfInventory("Climbing",1,"Climbing")
goto Rest
Rest:
//TNT1 A 1 A_JumpIf(momz==0, "Rest2")
TNT1 A 1 A_JumpIf(z-floorz<1, "Rest2")
goto Flash
Rest2:
TNT1 A 1 A_GiveInventory("StaminaFlag",10)
goto Flash
Climbing:
TNT1 A 1
goto Flash
NoFlash:
TNT1 A 0
stop

BotFire:
TNT1 A 0 A_JumpIfCloser(100, "AltFire")
TNT1 A 0 A_Jump(181,2)
TNT1 A 0 A_GiveInventory("BotJumpC",1)
RetreatFire:
TNT1 A 0 A_GiveInventory("BotRetreatFlag",1)
BUIN A 0 A_GiveInventory("MetalmanMain_CI",1)
BUIN A 0 A_PlayWeaponSound("weapon/metalblade")
BUIN BCDEF 2
TNT1 A 0 A_TakeInventory("BotRetreatFlag",999)
BUIN A 0 A_ReFire
Goto Ready+2

}
}

actor MetalManBlade : MetalBlade
{
Translation "199:199=4:4"
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("WallBlade")
stop
Floor:
MEGR U 0 A_SpawnItemEx("FloorBlade",0,0,0,30,0,0,0,1)
stop
Ceiling:
MEGR U 0 A_SpawnItemEx("CeilingBlade",0,0,0,0,0,0,0,1)
MEGR U 0 A_SpawnItemEx("CeilingBlade2",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 FloorBlade : MetalManBlade
{
-NOGRAVITY
Speed 30
States
{
Spawn:
MEGR T 1
MEGR T 0 A_GiveInventory("Clip",1)
MEGR UT 1 //A_Recoil(-2)
goto Spawn+2
Death:
TNT1 A 0 A_JumpIfInventory("Clip",1,"Continue")
TNT1 A 1
stop
Continue:
//TNT1 A 0 A_CustomMissile("FloorBlade",0,0,0,2,0)
TNT1 A 0 A_SpawnItemEx("FloorBlade",0,0,0,30,0,0,0,1)
TNT1 A 1
stop
}
}

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

actor CeilingBlade : MetalManBlade
{
-NOGRAVITY
Speed 0
}

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

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

actor ChainBladeB : ChainBlade{translation "199:199=74:74"}
actor ChainBladeR : ChainBlade{translation "199:199=41:41"}
actor ChainBladeO : ChainBlade{translation "199:199=128:128"}
actor ChainBladeP : ChainBlade{translation "199:199=232:232"}


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

actor MetalClimb : CustomInventory
{
states
{
Pickup:
TNT1 A 0
TNT1 A 0 A_JumpIfInventory("FlightDisableFlag",1,"No")
TNT1 A 0 A_JumpIfInventory("StaminaFlag",1,"Success")
stop
Success:
TNT1 A 0 A_TakeInventory("StaminaFlag",3)
TNT1 A 0 ThrustThingZ(0,16,0,0)
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("ChainBlade",0,1,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("ChainBladeB",0,1,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("ChainBladeR",0,1,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("ChainBladeO",0,1,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("ChainBladeP",0,1,8,0)
goto Done
}
}


