actor MegaBusterC : Megabuster 12341
{
Weapon.AmmoUse 1
Weapon.AmmoGive 3
Weapon.SlotNumber 1
scale 2.0
Obituary "%o was bombed by %k's Mega Buster."
Inventory.Pickupmessage "You got the Mega Buster!"
weapon.ammotype "BusterAmmo"
+WEAPON.AMMO_OPTIONAL
+WEAPON.DONTBOB
States
{
Spawn:
TNT1 A 0
stop
Ready:
CBUS A 0 A_JumpIfInventory("Once",1,"Ready2")
BUST B 0 ACS_ExecuteAlways(981,0,0)
PROC J 0 A_GiveInventory("Once",1)
Goto Ready2
Ready2:
PROC J 0 ACS_ExecuteAlways(998,0,0)
PROC J 0 A_TakeInventory("MegaCharge",999)
CBUS AA 1 A_WeaponReady
CBUS A 1 A_WeaponReady
Goto Ready2+4
Deselect:
MKIC A 0 A_TakeInventory("MegaSlide",1)
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
CBUS A 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
CBUS A 1 A_Raise
Loop
Fire:
MKIC A 0 A_TakeInventory("MegaSlide",1)
PROC D 0 A_JumpIfNoAmmo("Hold")
PROC D 0 A_PlaySoundEx("weapon/mbuster","Weapon")
PROC D 0 A_FireCustomMissile("MegaShot",0,0,8,0)
CBUS CBA 2 A_TakeInventory("MegaCharge",999)
CBUS A 1 A_Refire
goto Ready2+2
Fire2:
PROC J 0 ACS_ExecuteAlways(991,0,0)
PROC D 0 A_TakeInventory("MegaCharge",999)
PROC F 0 A_PlaySoundEx("weapon/pshot","Weapon")
CBUS C 3 A_FireCustomMissile("MegaShot2",0,0,8,0)
CBUS CBA 3
PROC D 0 A_Refire
goto Ready2+2
Fire3:
PROC J 0 ACS_ExecuteAlways(991,0,0)
PROC D 0 A_TakeInventory("MegaCharge",999)
PROC D 0 A_PlaySoundEx("weapon/pshot","Weapon")
CBUS C 0 //A_FireCustomMissile("ProtoShotFX",0,0,8,0)
CBUS C 3 A_FireCustomMissile("MegaShot3",0,0,8,0)
CBUS BA 3
CBUS A 9
PROC D 0 A_Refire
goto Ready2+1
Hold:
PROC D 0 A_JumpIfInventory("MegaCharge",33,"BotCheck")
PROC D 0 A_JumpIfInventory("MegaCharge",32,"Charge2")
PROC D 0 A_JumpIfInventory("MegaCharge",18,"Charge")
CBUS B 1 A_GiveInventory("MegaCharge",1)
PROC D 0 A_Refire
Goto Ready2+1
BotCheck:
BUST C 0 ACS_ExecuteAlways(974,0)
Goto Fire3
Charge:
PROC D 0 A_JumpIfInventory("MegaCharge",33,"BotCheck")
PROC D 0 A_JumpIfInventory("MegaCharge",32,"Charge2")
PROC D 0 A_JumpIfInventory("MegaCharge",19,"Charge1")
CBUS B 1 
PROC D 0 A_PlaySoundEx("weapon/coilstart","Weapon")
Goto Charge1
Charge1:
PROC D 0 A_JumpIfInventory("MegaCharge",33,"BotCheck")
PROC J 0 A_JumpIfInventory("MegaCharge",32,"Charge2")
PROC H 0 
CBUS B 0 ACS_ExecuteAlways(991,0,0)
CBUS B 1 A_GiveInventory("MegaCharge",1)
PROC H 0 ACS_ExecuteAlways(991,0,300)
CBUS F 2
PROC H 0 A_Refire
Goto Fire2
Charge2:
PROC D 0 A_PlaySoundEx("weapon/coilcharge","Weapon")
BUST C 0 ACS_ExecuteAlways(974,0)
CBUS D 0 ACS_ExecuteAlways(991,0,301)
CBUS D 1
PROC H 0 ACS_ExecuteAlways(991,0,302)
CBUS E 1
PROC H 0 ACS_ExecuteAlways(991,0,0)
BUST C 2
PROC H 0 A_Refire
Goto Fire3
Altfire:
MKIC C 0 A_JumpIf(z-floorz==0,"SlideSlide") //A_JumpIf(momz==0, "SlideSlide")
Goto Ready2+1
SlideSlide:
MKIC C 0 A_JumpIfNoAmmo("NoAmmo")
MKIC A 0 A_GiveInventory("MegaSlide",1)
MKIC C 0 A_PlaySoundEx("weapon/chargekick","Weapon")
MKIC C 0 SetPlayerProperty(0,1,0)
MKIC C 0 ACS_ExecuteAlways(648,0,4)
MKIC C 2 A_GiveInventory("SlideThrust",1)
MKIC A 8 //A_GiveInventory("StayDown",1) //SetPlayerProperty(0,0,0)
MKIC B 5 SetPlayerProperty(0,0,0)
MKIC C 5 ACS_ExecuteAlways(648,0,3)
MKIC A 0 A_TakeInventory("MegaSlide",1)
MKIC C 0 A_Refire
NoAmmo:
CBUS A 1 ACS_Execute(979,0)
Goto Ready2+1
}
}

actor MegaCharge : Inventory
{
inventory.amount 1
inventory.maxamount 52
}

/*
actor StayDown : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
States
{
Pickup:
TNT1 A 0 A_JumpIf(Momz>0,"Down")
stop
Down:
TNT1 A 0 ThrustThingZ(0,0,1,0)
stop
}
}
*/

actor SlideThrust : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
States
{
Pickup:
//TNT1 A 0 A_JumpIf(Momz>0,"Down")
TNT1 A 0 ThrustThingZ(0,0,1,0)
TNT1 A 0 A_Recoil(-25)
stop
Down:
TNT1 A 0 ThrustThingZ(0,0,1,0)
TNT1 A 0 A_Recoil(-20)
stop
}
}

actor MegaShot2
{
PROJECTILE
+LOOKALLAROUND
+SKYEXPLODE
+DONTBLAST
damagetype "Buster"
//seesound "weapon/mbuster"
Speed 26
Damage (21)
radius 20
height 20
scale 2.5
States
{
Spawn:
MBUS AB 2
loop
}
}


actor MegaShot3
{
PROJECTILE
+LOOKALLAROUND
+SKYEXPLODE
+DONTBLAST
damagetype "Proto3"
//seesound "weapon/mbuster"
Speed 26
Damage (50)
radius 25
height 25
scale 2.5
States
{
Spawn:
MBU2 ABC 2
MBUS B 2
loop
}
}

actor MegaSlide : Inventory
{
inventory.amount 1
inventory.maxamount 1
}