actor MetalBladeBoss : MegaBuster 20048
{
Weapon.AmmoUse 0
Weapon.AmmoGive 28
Weapon.SlotNumber 1
Obituary "%o was sliced by %k's Metal Blade."
weapon.ammotype "MootalAmmo"
inventory.pickupsound "weapon/weaponup"
+WEAPON.AMMO_OPTIONAL
Scale 2.0
States
{
Spawn:
WEAP S 1
loop
Ready:
BUIN A 0 ACS_ExecuteAlways(991,0,67)
BUIN A 0 A_GunFlash
SNAB A 0 A_TakeInventory("Climbing",1)
BUIN A 10 A_WeaponReady(WRF_NOSWITCH)
BUIN A 0 A_GiveInventory("MootalAmmo",1)
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_FireCustomMissile("MetalManBlade",0,1,8,0)
BUIN A 0 A_FireCustomMissile("MetalManBlade2",0,0,8,0)
BUIN A 0 A_PlayWeaponSound("weapon/metalblade")
BUIN BCDEF 2
BUIN A 3 A_ReFire
Goto Ready+2
Altfire:
SNAB A 0 A_GiveInventory("Climbing",1)
BUIN A 0 A_PlayWeaponSound("weapon/MetalMelee")
BUIN D 3 A_FireCustomMissile("ChainBlade",0,0,8,0)
goto Ready+3
Flash:
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("Stamina",10)
goto Flash
Climbing:
TNT1 A 1
goto Flash
NoFlash:
TNT1 A 0
stop
}
}

actor MetalManBlade : MetalBladeC
{
States
{
Spawn:
METL AB 1
loop
}
}

actor MetalManBlade2 : MetalManBlade
{
-RIPPER
Damage (0)
States
{
Death:
METL B 0 A_JumpIf(z-floorz<5, "Floor")
METL B 0 A_JumpIf(z-ceilingz==0-4, "Ceiling")
//METL B 0 A_SpawnItemEx("WallBlade")
stop
Floor:
METL B 0 A_SpawnItemEx("FloorBlade",0,0,0,30,0,0)
stop
Ceiling:
METL B 0 A_SpawnItemEx("CeilingBlade")
METL B 0 A_SpawnItemEx("CeilingBlade2")
stop
XDeath:
METL B 0
stop
}
}

actor FloorBlade : MetalManBlade
{
-NOGRAVITY
Speed 30
States
{
Spawn:
METL A 1
METL A 0 A_GiveInventory("Clip",1)
METL BA 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 1
stop
}
}

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

actor CeilingBlade : MetalManBlade
{
-NOGRAVITY
Speed 0
}

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

actor ChainBlade
{
PROJECTILE
scale 2.5
+RIPPER
+DONTBLAST
Speed 64
Radius 3
Height 4
Damage (6)
Damagetype "Metal" 
States
{
Spawn:
METL AB 1
stop
Death:
TNT1 A 0 A_GiveToTarget("MetalClimb",1)
stop
XDeath:
Crash:
TNT1 A 1
stop
}
}


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

actor MetalClimb : Climb
{
states
{
Success:
TNT1 A 0 A_TakeInventory("Stamina",2)
TNT1 A 0 ThrustThingZ(0,14,0,0)
stop
}
}