actor MegaBusterC : ArrowBuster
{
dropitem "CopyClassUpgradeDropped"
Obituary "$OB_MEGABUSTER"
Inventory.Pickupmessage "You got the Mega Buster!"
Tag "$TAG_MEGABUSTER"
States
{
Spawn:
C_00 B 1
loop
Ready:
BUST B 0 A_JumpIfInventory("Once",1,"Ready2")
BUST B 0 ACS_ExecuteAlways(981,0,0)
BUST B 0 A_GiveInventory("Once",1)
Goto Ready2
/*
Ready2:
BUST B 0 ACS_ExecuteAlways(998,0,701)
BUST B 0 ACS_ExecuteAlways(991,0,701)
BUST B 0 A_TakeInventory("WeaponCharge",999)
BUST B 2 A_WeaponReady
Goto Ready2+2
*/
Deselect:
MKIC A 0 A_TakeInventory("MegaSlide",1)
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
BUST B 1 A_Lower
Loop
Fire:
BUST B 0 A_JumpIfNoAmmo("Hold")
BUST B 0 A_PlaySoundEx("weapon/mbuster","Weapon")
BUST B 0 A_GiveInventory("MegamanMain_CI",1)
BUST B 0 A_TakeInventory("WeaponCharge",999)
BUST CD 3
//BUST B 1
BUST B 0 A_Refire
goto Ready2+2
BotFire:
BUST B 0 A_Jump(16, "Fire3")
CHBU H 0 A_Refire
Goto Fire3

Fire2:
BUST B 0 A_TakeInventory("WeaponCharge",999)
BUST C 0 A_PlaySoundEx("weapon/minchrgshot","Weapon")
BUST C 0 A_GiveInventory("MegamanMain2_CI",1)
BUST CD 3
BUST B 0 A_Refire
goto Ready2+2

Fire3:
BUST B 0 A_TakeInventory("WeaponCharge",999)
BUST B 0 A_PlaySoundEx("weapon/cfire2","Weapon")
BUST B 0
BUST C 0 ACS_ExecuteAlways(991,0,0)
BUST C 3 A_GiveInventory("MegamanMain3_CI",1)
BUST CD 3 
BUST C 9
BUST B 0 A_Refire
goto Ready2+2

Hold:
BUST B 0 A_JumpIfInventory("WeaponCharge",34,"Charge2")
BUST B 0 A_JumpIfInventory("WeaponCharge",18,"Charge")
BUST B 1 A_GiveInventory("WeaponCharge",1)
BUST B 0 A_Refire
Goto Ready2+2

Charge:
BUST B 0 A_JumpIfInventory("WeaponCharge",34,"Charge2")
BUST B 0 A_JumpIfInventory("WeaponCharge",19,"Charge1")
BUST B 0 A_PlaySoundEx("weapon/coilstart","Weapon")
Goto Charge1

Charge1:
BUST B 0 A_JumpIfInventory("WeaponCharge",34,"Charge2")
LBST H 1 ACS_ExecuteAlways(998,0,106,5)
BUST B 1 ACS_ExecuteAlways(998,0,701,1)
BUST B 0 A_GiveInventory("WeaponCharge",1)
CHBU H 0 A_Refire
Goto Fire2

Charge2:
BUST B 1 ACS_ExecuteAlways(998,0,93,6)
CHBU I 1 ACS_ExecuteAlways(998,0,94,7)
CHBU J 1 ACS_ExecuteAlways(998,0,701,5)
BUST B 0 A_JumpIfInventory("WeaponCharge", 35, 3)
BUST B 0 A_GiveInventory("WeaponCharge",1)
BUST B 0 A_GunFlash
BUST B 0 A_JumpIfInventory("IsBot", 1, "BotFire")
BUST B 0 A_Refire
Goto Fire3

Flash:
TNT1 A 5 A_PlaySoundEx("weapon/coilcharge", "Weapon")
TNT1 A 0 A_JumpIfInventory("IsDead",1,"NoFlash")
TNT1 A 0 A_JumpIfInventory("WeaponCharge",1,"Flash")
stop

Altfire:
MKIC C 0 A_JumpIf(z-floorz==0,"SlideSlide") //A_JumpIf(momz==0, "SlideSlide")
Goto Ready2+2
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("CopySlidePickup",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
Goto Ready2+2
NoAmmo:
CBUS A 1 ACS_Execute(979,0)
Goto Ready2+2
}
}

actor LaserBusterC : LaserBuster
{
dropitem "LaserBusterUpgrade2GiverDropped"
states
{
TakeBusters:
BUST B 0 A_GiveInventory("TakeBusterC", 1)
Goto Ready2

Charge1:
BUST B 0 A_JumpIfInventory("WeaponCharge",34,"Charge2")
LBST H 1 ACS_ExecuteAlways(998,0,106,5)
BUST B 1 ACS_ExecuteAlways(998,0,0,1)
BUST B 0 A_GiveInventory("WeaponCharge",1)
CHBU H 0 A_Refire
Goto Fire2
Charge2:
LBST I 1 ACS_ExecuteAlways(998,0,107,6)
BUST B 1 ACS_ExecuteAlways(998,0,0,5)
LBST I 1 ACS_ExecuteAlways(998,0,107,7)
BUST B 0 A_JumpIfInventory("WeaponCharge", 35, 3)
BUST B 0 A_GiveInventory("WeaponCharge",1)
BUST B 0 A_GunFlash
BUST B 0 A_JumpIfInventory("IsBot", 1, "BotFire")
BUST B 0 A_Refire
Goto Fire3

Altfire:
MKIC C 0 A_JumpIf(z-floorz==0,"SlideSlide") //A_JumpIf(momz==0, "SlideSlide")
Goto Ready2+2
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("CopySlidePickup",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
Goto Ready2+2
}
}

actor ArrowBusterC : ArrowBuster
{
dropitem "ArrowBusterUpgrade2GiverDropped"
states
{
TakeBusters:
BUST B 0 A_GiveInventory("TakeBusterC", 1)
Goto Ready2

Charge1:
BUST B 0 A_JumpIfInventory("WeaponCharge",34,"Charge2")
CHBU H 1 ACS_ExecuteAlways(998,0,92,5)
BUST B 1 ACS_ExecuteAlways(998,0,0,1)
BUST B 0 A_GiveInventory("WeaponCharge",1)
CHBU H 0 A_Refire
Goto Fire2
Charge2:
BUST B 1 ACS_ExecuteAlways(998,0,93,6)
CHBU I 1 ACS_ExecuteAlways(998,0,94,7)
CHBU J 1 ACS_ExecuteAlways(998,0,0,5)
BUST B 0 A_JumpIfInventory("WeaponCharge", 35, 3)
BUST B 0 A_GiveInventory("WeaponCharge",1)
BUST B 0 A_GunFlash
BUST B 0 A_JumpIfInventory("IsBot", 1, "BotFire")
BUST B 0 A_Refire
Goto Fire3

Altfire:
MKIC C 0 A_JumpIf(z-floorz==0,"SlideSlide") //A_JumpIf(momz==0, "SlideSlide")
Goto Ready2+2
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("CopySlidePickup",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
Goto Ready2+2
}
}

actor SuperAdaptorWepC : SuperAdaptorWep
{
dropitem "AdaptorUpgrade2GiverDropped"
States
{
TakeBusters:
SAPT A 0 A_GiveInventory("TakeBusterC", 1)
Goto Ready2

Charge1:
SAPT A 0 A_JumpIfInventory("WeaponCharge",35,"Charge2")
SAPT A 0 
SAPT A 0 ACS_ExecuteAlways(998,0,77,1)
SAPT A 1 A_GiveInventory("WeaponCharge",1)
SAPT A 0 ACS_ExecuteAlways(998,0,78,5)
SAPT D 1 //A_GiveInventory("AdapterCharge",1)
SAPT A 0 A_Refire
Goto Fire
Charge2:
SAPT G 1 ACS_ExecuteAlways(998,0,79,6)
SAPT H 1 ACS_ExecuteAlways(998,0,80,7)
SAPT K 1 ACS_ExecuteAlways(998,0,77,1)
SAPT K 0 A_JumpIfInventory("IsBot", 1, "BotFire")
SAPT A 0 A_Refire
Goto Fire2
}
}

/*
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 MegaShotC : MegaShot
{
Translation "204:204=215:215"
-SKYEXPLODE
States
{
Spawn:
TNT1 A 2
BUST T 1
wait
Death:
BUST T 1
stop
}
}

actor MegaShotCB : MegaShotC{translation "204:204=205:205"}
actor MegaShotCR : MegaShotC{translation "204:204=171:171"}
actor MegaShotCO : MegaShotC{translation "204:204=104:104"}
actor MegaShotCP : MegaShotC{translation "204:204=229:229"}


actor MidShotC : MidShot
{
Translation "204:204=215:215"
-SKYEXPLODE
States
{
Spawn:
TNT1 A 2
MBU2 DE 2
Goto Spawn+1
}
}

actor MidShotCB : MidShotC{translation "204:204=205:205"}
actor MidShotCR : MidShotC{translation "204:204=171:171"}
actor MidShotCO : MidShotC{translation "204:204=104:104"}
actor MidShotCP : MidShotC{translation "204:204=229:229"}


actor MegaShot3
{
Translation "198:198=198:198", "202:202=193:193", "204:204=215:215"
PROJECTILE
damagetype "MegaBuster3"
Obituary "$OB_MEGABUSTER"
Speed 26
Damage (50)
radius 25
height 25
scale 2.5
States
{
Spawn:
MBU2 ABCE 2
loop
}
}

actor MegaShot3B : MegaShot3{translation "202:202=205:205", "204:204=205:205", "198:198=74:74"}
actor MegaShot3R : MegaShot3{translation "202:202=171:171", "204:204=171:171", "198:198=41:41"}
actor MegaShot3O : MegaShot3{translation "202:202=104:104", "204:204=104:104", "198:198=128:128"}
actor MegaShot3P : MegaShot3{translation "202:202=229:229", "204:204=229:229", "198:198=232:232"}




actor MegamanMain_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("MegaShotC",0,0,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("MegaShotCB",0,0,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("MegaShotCR",0,0,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("MegaShotCO",0,0,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("MegaShotCP",0,0,8,0)
goto Done
}
}

actor MegamanMain2_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("MidShotC",0,0,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("MidShotCB",0,0,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("MidShotCR",0,0,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("MidShotCO",0,0,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("MidShotCP",0,0,8,0)
goto Done
}
}

actor MegamanMain3_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("MegaShot3",0,0,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("MegaShot3B",0,0,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("MegaShot3R",0,0,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("MegaShot3O",0,0,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("MegaShot3P",0,0,8,0)
goto Done
}
}