actor MaestroShieldCount : Inventory
{
inventory.amount 1
inventory.maxamount 105
}

actor MaestroShieldCount_RC : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("PowerRage_ST",1,"Pickup2")
TNT1 A 0 A_GiveInventory("MaestroShieldCount",1)
stop
Pickup2:
TNT1 A 0 A_GiveInventory("MaestroShieldCount",2)
stop
}
}

actor MaestroShieldBlock : Powerup
{
powerup.duration 1
}

actor MaestroShieldAmmo : Inventory
{
inventory.amount 1
inventory.maxamount 30
}

actor HeatShieldChecker : Once{}
actor AquaShieldChecker : Once{}
actor ElecShieldChecker : Once{}
actor WoodShieldChecker : Once{}

actor MaestroHeatShield : BaseMM8BDMWep_CBM
{
tag "$TAGC_0C9"
dropitem "CopyClassUpgradeDropped"

weapon.preferredskin "Maestro-Shield"
Weapon.SlotNumber 1
Obituary "$OB_ROCKBUSTER"
Inventory.Pickupmessage "You got Maestro.exe!"
weapon.ammotype "EXEAmmo"
inventory.pickupsound ""
inventory.icon "MaesHSIc"
States
{
ThumbsUp:  
HUTB A 2 Offset(20,62)
HUTB A 2 Offset(40,92) 
HUST Z 2 Offset(-30,102)A_PlaySoundEx("weapon/RockThumbsUp","Weapon")
HUST Z 0 A_Refire(1)
HUST Z 2 Offset(-15,67)
HUST Z 2 Offset(1,31)
goto ThumbsUpH
ThumbsUpH:
HUST Z 1 Offset(1,31)A_RailWait
HUST Z 0 A_JumpIfInventory("MaestroBusterFlag",1,"ThumbsUpH")
goto ThumbsUpEnd
ThumbsUpEnd:
HUST Z 2 Offset(-15,67)
HUST Z 2 Offset(-30,102) 
HUTB A 2 Offset(40,92)
HUTB A 2 Offset(20,62)
goto Ready2+1

Spawn:
C_00 C 1
loop

Ready:
HUTB A 0 A_JumpIfInventory("Once",1,"ReadyNoIntro")
Goto ReadyIntro

Ready2:
HUTB A 0 ACS_ExecuteAlways(998,0,12000,1)
HUTB A 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB A 0 A_JumpIfInventory("MaestroBusterFlag",1,"ThumbsUp")
HUTB A 1 A_WeaponReady(WRF_ALLOWRELOAD)
Goto Ready2+1

Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
HUTB A 1 A_Lower
Loop

Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
HUTB A 1 A_Raise
Loop

ReadyIntro:
HUSS C 0 ACS_NamedExecuteAlways("CCBM_MaestroStyleChangeEnd",0,13)
HUSS C 0 A_PlaySoundEx("weapon/lflready","Weapon")
HUSS C 0 ACS_ExecuteAlways(998,0,12000,1)
HUSS C 0 ACS_ExecuteAlways(991,0,12000)
HUTU A 1 Offset(-6,41)A_GiveInventory("MaestroShieldCount",18)
TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("CentaurFlashCFX",0,0,28,22,0,random2(256/12),random(0,359),1)
HUTU B 1 Offset(-12,50)A_GiveInventory("MaestroShieldCount",18)
HUTU C 1 Offset(-18,59)A_GiveInventory("MaestroShieldCount",18)
HUTU D 1 Offset(-24,68)A_GiveInventory("MaestroShieldCount",18)
HUTU E 0 Offset(-30,77)A_GiveInventory("Once",1)
HUTU E 1 Offset(-30,77)A_GiveInventory("MaestroShieldCount",18)
HUTU E 1 Offset(-30,77)A_GiveInventory("MaestroShieldCount",18)
HUTU E 4 Offset(-30,77)
HUTU E 1 Offset(-24,68)
HUTU E 1 Offset(-18,59)
HUTU E 1 Offset(-12,50)
HUTU E 1 Offset(-6,41)
HUTU E 6 Offset(0,32)
HUTU E 1 Offset(-21,72)
HUTU E 1 Offset(-43,107)
TNT1 A 3 Offset(40,92)
HUTB A 1 Offset(40,92)
HUTB A 1 Offset(20,62)
HUTB A 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
goto Ready2+1

ReadyNoIntro:
HUTB A 1 ACS_ExecuteAlways(998,0,12000,1)
goto Ready2+1


Fire:
HUTB B 0 A_JumpIfInventory("MaestroShieldAmmo",10,"FireEX")
HUTB B 0 A_JumpIfInventory("PowerRage_ST",1,"FireR")
HUTB B 0 ACS_ExecuteAlways(998,0,12000,1)
HUTB B 0 A_PlaySoundEx("weapon/RockBuster","Weapon")
HUTB B 0 A_TakeInventory("WeaponCharge",999)
HUTB B 0 A_GiveInventory("MaestroMain_CI",1)
HUTB B 1 Offset(5, 37)//41
HUTB B 1 Offset(9, 41)//45
HUTB B 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB B 1 Offset(10, 42)//46
HUTB A 1 Offset(9, 41)//45
HUTB A 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB A 1 Offset(5, 37)//41
HUTB A 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
HUTB A 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB A 2 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
HUTB A 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB A 0 A_Refire("Hold")
HUTB A 0 ACS_NamedExecuteAlways("BULL_SetState",0,2)
goto Ready2+1

FireR:
HUTB B 0 ACS_ExecuteAlways(998,0,12000,1)
HUTB B 0 A_PlaySoundEx("weapon/RockBuster","Weapon")
HUTB B 0 A_TakeInventory("WeaponCharge",999)
HUTB B 0 A_GiveInventory("MaestroMain_CI",1)
HUTB B 1 Offset(5, 37)//41
HUTB B 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB B 1 Offset(10, 42)//46
HUTB A 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB A 1 Offset(5, 37)//41
HUTB A 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
HUTB A 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB A 0 A_Refire("Hold")
HUTB A 0 ACS_NamedExecuteAlways("BULL_SetState",0,2)
goto Ready2+1

Fire2:
HUTB A 1 A_StopSoundEx("Weapon")
goto Fire

Fire3:
HUTB B 0 ACS_ExecuteAlways(998,0,12000,1)
HUTB D 1 Offset(-9,23)
HUTB A 1 Offset(-18,14)
HUTB A 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB A 0 A_PlaySoundEx("weapon/magmabazooka","Weapon")
HUTB A 0 A_SpawnItemEx("BurnExplosionSound")
HUTB A 0 A_TakeInventory("WeaponCharge",999)
HUTB D 1 Offset(-18,10)A_GiveInventory("MaestroHeatMain_CI",1)
HUTB A 1 Offset(-18,14)A_GiveInventory("MaestroHeatMain_CI",1)
HUTB A 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB D 1 Offset(-18,10)A_GiveInventory("MaestroHeatMain_CI",1)
HUTB A 1 Offset(-18,14)A_GiveInventory("MaestroHeatMain_CI",1)
HUTB A 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB D 1 Offset(-18,10)A_GiveInventory("MaestroHeatMain_CI",1)
HUTB A 1 Offset(-18,14)A_GiveInventory("MaestroHeatMain_CI",1)
HUTB A 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB D 1 Offset(-18,10)A_GiveInventory("MaestroHeatMain_CI",1)
HUTB A 1 Offset(-18,14)A_GiveInventory("MaestroHeatMain_CI",1)
HUTB A 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB D 1 Offset(-18,10)A_GiveInventory("MaestroHeatMain_CI",1)
HUTB A 1 Offset(-18,14)A_GiveInventory("MaestroHeatMain_CI",1)
HUTB A 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB A 1 Offset(-18,14)
HUTB A 1 Offset(-9,23)
HUTB A 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB A 2 A_WeaponReady(14)
HUTB A 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB A 2 A_WeaponReady(14)
HUTB A 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB A 2 A_WeaponReady(14)
HUTB A 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB A 2 A_WeaponReady(14)
HUTB A 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB A 1 A_WeaponReady(14)
HUTB A 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB A 0 A_Refire("Hold")
goto Ready2+1

FireEX:
HUTB B 0 ACS_ExecuteAlways(998,0,12000,1)
HUTB D 1 Offset(-9,23)
HUTB A 1 Offset(-18,14)
HUTB A 0 A_PlaySoundEx("weapon/magmabazooka","Weapon")
HUTB A 0 A_SpawnItemEx("BurnExplosionSound")
HUTB A 0 A_TakeInventory("WeaponCharge",999)
HUTB D 1 Offset(-18,10)A_GiveInventory("MaestroHeatMain_CI",1)
HUTB D 0 Offset(-18,10)A_TakeInventory("MaestroShieldAmmo",2)
HUTB A 1 Offset(-18,14)A_GiveInventory("MaestroHeatMain_CI",1)
HUTB A 0 Offset(-18,14)A_TakeInventory("MaestroShieldAmmo",2)
HUTB D 1 Offset(-18,10)A_GiveInventory("MaestroHeatMain_CI",1)
HUTB D 0 Offset(-18,10)A_TakeInventory("MaestroShieldAmmo",2)
HUTB A 1 Offset(-18,14)A_GiveInventory("MaestroHeatMain_CI",1)
HUTB A 0 Offset(-18,14)A_TakeInventory("MaestroShieldAmmo",2)
HUTB D 1 Offset(-18,10)A_GiveInventory("MaestroHeatMain_CI",1)
HUTB D 0 Offset(-18,10)A_TakeInventory("MaestroShieldAmmo",2)
HUTB A 1 Offset(-18,14)
HUTB A 1 Offset(-9,23)
HUTB A 9 A_WeaponReady(14)
HUTB A 0 A_Refire("Hold")
goto Ready2+1

Hold:
HUTB A 1 A_JumpIfInventory("MaestroShieldAmmo",10,"FireEX")
HUTB A 0 A_GiveInventory("WeaponCharge_MaestroRC",1)
HUTB A 0 A_JumpIfInventory("WeaponCharge",9,"Hold2")
HUTB A 0 A_Refire("Hold.b")
goto Fire2

Hold.b:
HUTB A 1 A_JumpIfInventory("MaestroShieldAmmo",10,"FireEX")
HUTB A 0 A_GiveInventory("WeaponCharge_MaestroRC",1)
HUTB A 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB A 0 A_JumpIfInventory("WeaponCharge",9,"Hold2")
HUTB A 0 A_Refire("Hold")
goto Fire2

Hold2:
HUTB C 0 A_PlaySoundEx("weapon/lflcharge","Weapon")

Hold2.a:
HUTB C 1 ACS_ExecuteAlways(998,0,12007,6)
HUTB C 0 A_GiveInventory("WeaponCharge_MaestroRC",1)//76
HUTB C 0 A_JumpIfInventory("WeaponCharge",76,"Hold3")
HUTB C 0 A_Refire("Hold2.b")
goto Fire2

Hold2.b:
HUTB A 1 ACS_ExecuteAlways(998,0,12000,1)
HUTB A 0 A_GiveInventory("WeaponCharge_MaestroRC",1)//76
HUTB A 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB A 0 A_JumpIfInventory("WeaponCharge",76,"Hold3")
HUTB A 0 A_Refire("Hold2.a")
goto Fire2

Hold3:
HUTB D 0 A_PlaySoundEx("weapon/lflready","Weapon")

Hold3.a:
HUTB D 1 ACS_ExecuteAlways(998,0,12008,7)
HUTB D 0 A_Refire("Hold3.b")
goto Fire3

Hold3.b:
HUTB A 1 ACS_ExecuteAlways(998,0,12000,1)
HUTB A 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB A 0 A_Refire("Hold3.a")
goto Fire3

Altfire:
HUTB A 1 A_JumpIfInventory("MaestroShieldCount",36,1)
goto Ready2+1
HUTB A 0 A_PlaySoundEx("weapon/maestroshield","Weapon")
HUTB A 1 Offset(-9,23)
HUTB A 1 Offset(-18,14)
HUTB A 0 A_SpawnItemEx("MaestroShieldSparkleFX",32,0,28,0,0,0,0,1,0)
Altfire2:
HUST GG 0 A_SpawnItemEx("MaestroShieldAbsorb",56,0,2,momx,momy,momz,0,9,0)
HUST G 0 A_SpawnItemEx("MaestroShieldFX",56,0,2,momx,momy,momz,0,9,0)
HUST G 1 Offset(-27,5)A_TakeInventory("MaestroShieldCount",1)
HUST G 0 A_JumpIfInventory("MaestroShieldCount",1,1)
goto AltfireEnd
HUST G 0 A_Refire("Altfire2")
goto AltfireEnd

AltfireEnd:
HUTB A 1 Offset(-18,14)
HUTB A 1 Offset(-9,23)
HUTB A 18 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
HUTB A 0 A_Refire("Altfire")
goto Ready2+1

Reload:
HUTB A 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
HUTB A 1 Offset(40,92)A_TakeInventory("Once",9)
HUTB A 1 Offset(20,62)A_GiveInventory("MaestroNeutralBoss",1)
TNT1 A 3 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
TNT1 A 0 A_TakeInventory("ScorchWheelWepCMaestro")
HUTU E 1 Offset(-43,107)
HUTU E 1 Offset(-21,72)
HUTU E 2 Offset(15,32)
HUTU D 2 Offset(15,32)
HUTU C 1 Offset(15,32)A_TakeInventory("MaestroShieldCount",18)
HUTU C 1 Offset(15,32)A_TakeInventory("MaestroShieldCount",18)
HUTU B 1 Offset(15,32)A_TakeInventory("MaestroShieldCount",18)
HUTU B 1 Offset(15,32)A_TakeInventory("MaestroShieldCount",18)
HUTU A 1 Offset(15,32)A_TakeInventory("MaestroShieldCount",18)
HUTU A 1 Offset(15,32)A_TakeInventory("MaestroShieldCount",18)
HUSS A 0 A_PlaySoundEx("weapon/MaestroFuzz","Weapon")
HUSS GFGFGFDEDEDECBA 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
TNT1 A 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
Reload2:
TNT1 A 1 ACS_NamedExecuteAlways("CCBM_MaestroStyleChangeRevert",0)
TNT1 A 8
loop
}
}

actor MaestroShieldFX : ProtoShieldFX
{
Renderstyle Translucent
Alpha 0.8
States
{
Spawn:
TNT1 A 0
HUSV A 1 A_SpawnItemEx("TheKingShieldSparkle2",random(4,8),random(-48,48),random(-4,70),0,0,0,0,1,196)
stop
}
}

actor MaestroShieldSparkleFX : BasicHelper
{
States
{
Spawn:
TNT1 A 0

TNT1 A 0 A_SpawnItemEx("TheKingShieldSparkle1",28,0,0,1,0,-3,0,1)

TNT1 A 0 A_SpawnItemEx("TheKingShieldSparkle1",28,-4,0,1,3,-2,0,1)
TNT1 A 0 A_SpawnItemEx("TheKingShieldSparkle1",28,4,0,1,-3,-2,0,1)

TNT1 A 0 A_SpawnItemEx("TheKingShieldSparkle1",28,-8,5,1,4,-1,0,1)
TNT1 A 0 A_SpawnItemEx("TheKingShieldSparkle1",28,8,5,1,-4,-1,0,1)

TNT1 A 0 A_SpawnItemEx("TheKingShieldSparkle1",28,-8,10,1,5,0,0,1)
TNT1 A 0 A_SpawnItemEx("TheKingShieldSparkle1",28,8,10,1,-5,0,0,1)

TNT1 A 0 A_SpawnItemEx("TheKingShieldSparkle1",28,-8,15,1,4,1,0,1)
TNT1 A 0 A_SpawnItemEx("TheKingShieldSparkle1",28,8,15,1,-4,1,0,1)

TNT1 A 0 A_SpawnItemEx("TheKingShieldSparkle1",28,-8,20,1,3,2,0,1)
TNT1 A 0 A_SpawnItemEx("TheKingShieldSparkle1",28,8,20,1,-3,2,0,1)

TNT1 A 0 A_SpawnItemEx("TheKingShieldSparkle1",28,0,25,1,0,3,0,1)
TNT1 A 1
stop
}
}

actor MaestroShieldAbsorb
{
var int user_USER;
-SOLID
+NOGRAVITY
+DONTDRAIN
species "MaestroShield"
health 1
radius 32
height 56
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SetUserVar("user_USER",ACS_ExecuteWithResult(257,0))
TNT1 A 0 A_ChangeFlag("SHOOTABLE",1)
TNT1 A 0 A_ChangeFlag("DONTRIP",1)
TNT1 A 1
stop
Death:
TNT1 A 0
TNT1 A 0 ACS_NamedExecuteAlways("Maestro_AltfireSnatch",0,1,user_USER,ACS_ExecuteWithResult(147,0))
stop
}
}

actor MaestroShieldPickup : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_JumpIfInventory("MaestroShieldBlock",1,"No")
TNT1 A 0 A_SpawnItemEx("KnightShieldDeathFX",56,0,2,0,0,0,0,9,0)
TNT1 A 0 A_PlaySound("item/protoreflect")
TNT1 A 0 A_GiveInventory("MaestroShieldAmmo",3)
TNT1 A 0 A_GiveInventory("MaestroShieldBlock",1)
stop

No:
TNT1 A 0
stop
}
}

actor HeatShieldPickup : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_GiveInventory("MaestroHeatShield",1)
TNT1 A 0 A_GiveInventory("ScorchWheelWepCMaestro",1)
TNT1 A 0 A_JumpIfInventory("HeatShieldChecker",1,"No")

TNT1 A 0 A_GiveInventory("HeatShieldChecker",1)
TNT1 A 0 A_GiveInventory("ScorchWheelAmmo",28)
stop
No:
TNT1 A 0
stop
}
}

actor ScorchWheelWepCMaestro : ScorchWheelWepC{Weapon.AmmoGive 0}

actor MaestroAquaShield : BaseMM8BDMWep_CBM
{
tag "$TAGC_0C10"
dropitem "CopyClassUpgradeDropped"

weapon.preferredskin "Maestro-Shield"
Weapon.SlotNumber 1
Obituary "$OB_ROCKBUSTER"
Inventory.Pickupmessage "You got Maestro.exe!"
weapon.ammotype "EXEAmmo"
inventory.pickupsound ""
inventory.icon "MaesASIc"
States
{
ThumbsUp:  
HUTB E 2 Offset(20,62)
HUTB E 2 Offset(40,92) 
HUST X 2 Offset(-30,102)A_PlaySoundEx("weapon/RockThumbsUp","Weapon")
HUST X 0 A_Refire(1)
HUST X 2 Offset(-15,67)
HUST X 2 Offset(1,31)
goto ThumbsUpH
ThumbsUpH:
HUST X 1 Offset(1,31)A_RailWait
HUST X 0 A_JumpIfInventory("MaestroBusterFlag",1,"ThumbsUpH")
goto ThumbsUpEnd
ThumbsUpEnd:
HUST X 2 Offset(-15,67)
HUST X 2 Offset(-30,102) 
HUTB E 2 Offset(40,92)
HUTB E 2 Offset(20,62)
goto Ready2+1

Spawn:
C_00 C 1
loop

Ready:
HUTB E 0 A_JumpIfInventory("Once",1,"ReadyNoIntro")
Goto ReadyIntro

Ready2:
HUTB E 0 ACS_ExecuteAlways(998,0,12001,1)
HUTB E 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB E 0 A_JumpIfInventory("MaestroBusterFlag",1,"ThumbsUp")
HUTB E 1 A_WeaponReady(WRF_ALLOWRELOAD)
Goto Ready2+1

Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
HUTB E 1 A_Lower
Loop

Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
HUTB E 1 A_Raise
Loop

ReadyIntro:
HUSS C 0 ACS_NamedExecuteAlways("CCBM_MaestroStyleChangeEnd",0,14)
HUSS C 0 A_PlaySoundEx("weapon/lflready","Weapon")
HUSS C 0 ACS_ExecuteAlways(998,0,12001,1)
HUSS C 0 ACS_ExecuteAlways(991,0,12001)
HUTU F 1 Offset(-6,41)A_GiveInventory("MaestroShieldCount",18)
TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("CentaurFlashCFX",0,0,28,22,0,random2(256/12),random(0,359),1)
HUTU G 1 Offset(-12,50)A_GiveInventory("MaestroShieldCount",18)
HUTU H 1 Offset(-18,59)A_GiveInventory("MaestroShieldCount",18)
HUTU I 1 Offset(-24,68)A_GiveInventory("MaestroShieldCount",18)
HUTU J 0 Offset(-30,77)A_GiveInventory("Once",1)
HUTU J 1 Offset(-30,77)A_GiveInventory("MaestroShieldCount",18)
HUTU J 1 Offset(-30,77)A_GiveInventory("MaestroShieldCount",18)
HUTU J 4 Offset(-30,77)
HUTU J 1 Offset(-24,68)
HUTU J 1 Offset(-18,59)
HUTU J 1 Offset(-12,50)
HUTU J 1 Offset(-6,41)
HUTU J 6 Offset(0,32)
HUTU J 1 Offset(-21,72)
HUTU J 1 Offset(-43,107)
TNT1 A 3 Offset(40,92)
HUTB E 1 Offset(40,92)
HUTB E 1 Offset(20,62)
HUTB E 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
goto Ready2+1

ReadyNoIntro:
HUTB E 1 ACS_ExecuteAlways(998,0,12000,1)
goto Ready2+1


Fire:
HUTB F 0 A_JumpIfInventory("MaestroShieldAmmo",10,"FireEX")
HUTB F 0 A_JumpIfInventory("PowerRage_ST",1,"FireR")
HUTB F 0 ACS_ExecuteAlways(998,0,12001,1)
HUTB F 0 A_PlaySoundEx("weapon/RockBuster","Weapon")
HUTB F 0 A_TakeInventory("WeaponCharge",999)
HUTB F 0 A_GiveInventory("MaestroMain_CI",1)
HUTB F 1 Offset(5, 37)//41
HUTB F 1 Offset(9, 41)//45
HUTB F 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB F 1 Offset(10, 42)//46
HUTB E 1 Offset(9, 41)//45
HUTB E 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB E 1 Offset(5, 37)//41
HUTB E 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
HUTB E 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB E 2 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
HUTB E 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB E 0 A_Refire("Hold")
HUTB E 0 ACS_NamedExecuteAlways("BULL_SetState",0,2)
goto Ready2+1

FireR:
HUTB F 0 ACS_ExecuteAlways(998,0,12000,1)
HUTB F 0 A_PlaySoundEx("weapon/RockBuster","Weapon")
HUTB F 0 A_TakeInventory("WeaponCharge",999)
HUTB F 0 A_GiveInventory("MaestroMain_CI",1)
HUTB F 1 Offset(5, 37)//41
HUTB F 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB F 1 Offset(10, 42)//46
HUTB E 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB E 1 Offset(5, 37)//41
HUTB E 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
HUTB E 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB E 0 A_Refire("Hold")
HUTB E 0 ACS_NamedExecuteAlways("BULL_SetState",0,2)
goto Ready2+1

Fire2:
HUTB E 1 A_StopSoundEx("Weapon")
goto Fire

Fire3:
HUTB H 0 ACS_ExecuteAlways(998,0,12001,1)
HUTB H 0 A_StopSoundEx("Body")
HUTB H 1 Offset(-9,23)
HUTB E 1 Offset(-18,14)
HUTB H 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB H 0 A_PlaySoundEx("weapon/waterwave","Weapon")
HUTB H 0 A_PlaySoundEx("wep/PumpShieldBurst","SoundSlot6")
HUTB H 0 A_TakeInventory("WeaponCharge",999)
HUTB H 1 Offset(-18,10)A_GiveInventory("MaestroAquaMain_CI",1)
HUTB E 1 Offset(-18,14)A_GiveInventory("MaestroAquaMain_CI",1)
HUTB E 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB H 1 Offset(-18,10)A_GiveInventory("MaestroAquaMain_CI",1)
HUTB E 1 Offset(-18,14)A_GiveInventory("MaestroAquaMain_CI",1)
HUTB E 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB H 1 Offset(-18,10)A_GiveInventory("MaestroAquaMain_CI",1)
HUTB E 1 Offset(-18,14)A_GiveInventory("MaestroAquaMain_CI",1)
HUTB E 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB H 1 Offset(-18,10)A_GiveInventory("MaestroAquaMain_CI",1)
HUTB E 1 Offset(-18,14)A_GiveInventory("MaestroAquaMain_CI",1)
HUTB E 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB H 1 Offset(-18,10)A_GiveInventory("MaestroAquaMain_CI",1)
HUTB E 1 Offset(-18,14)A_GiveInventory("MaestroAquaMain_CI",1)
HUTB E 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB E 1 Offset(-18,14)
HUTB E 1 Offset(-9,23)
HUTB E 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB E 2 A_WeaponReady(14)
HUTB E 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB E 2 A_WeaponReady(14)
HUTB E 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB E 2 A_WeaponReady(14)
HUTB E 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB E 2 A_WeaponReady(14)
HUTB E 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB E 1 A_WeaponReady(14)
HUTB E 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB E 0 A_Refire("Hold")
goto Ready2+1

FireEX:
HUTB H 0 ACS_ExecuteAlways(998,0,12001,1)
HUTB H 1 Offset(-9,23)
HUTB E 1 Offset(-18,14)
HUTB H 0 A_PlaySoundEx("weapon/waterwave","Weapon")
HUTB H 0 A_PlaySoundEx("wep/PumpShieldBurst","SoundSlot6")
HUTB H 0 A_TakeInventory("WeaponCharge",999)
HUTB H 1 Offset(-18,10)A_GiveInventory("MaestroAquaMainGuts_CI",1)
HUTB H 0 Offset(-18,10)A_TakeInventory("MaestroShieldAmmo",2)
HUTB E 1 Offset(-18,14)A_GiveInventory("MaestroAquaMainGuts_CI",1)
HUTB E 0 Offset(-18,14)A_TakeInventory("MaestroShieldAmmo",2)
HUTB H 1 Offset(-18,10)A_GiveInventory("MaestroAquaMainGuts_CI",1)
HUTB H 0 Offset(-18,10)A_TakeInventory("MaestroShieldAmmo",2)
HUTB E 1 Offset(-18,14)A_GiveInventory("MaestroAquaMainGuts_CI",1)
HUTB E 0 Offset(-18,14)A_TakeInventory("MaestroShieldAmmo",2)
HUTB H 1 Offset(-18,10)A_GiveInventory("MaestroAquaMainGuts_CI",1)
HUTB H 0 Offset(-18,10)A_TakeInventory("MaestroShieldAmmo",2)
HUTB E 1 Offset(-18,14)
HUTB E 1 Offset(-9,23)
HUTB E 9 A_WeaponReady(14)
HUTB E 0 A_Refire("Hold")
goto Ready2+1

Hold:
HUTB E 1 A_JumpIfInventory("MaestroShieldAmmo",10,"FireEX")
HUTB E 0 A_GiveInventory("WeaponCharge_MaestroRC",1)
HUTB E 0 A_JumpIfInventory("WeaponCharge",9,"Hold2")
HUTB E 0 A_Refire("Hold.b")
goto Fire2

Hold.b:
HUTB E 1 A_JumpIfInventory("MaestroShieldAmmo",10,"FireEX")
HUTB E 0 A_GiveInventory("WeaponCharge_MaestroRC",1)
HUTB E 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB E 0 A_JumpIfInventory("WeaponCharge",9,"Hold2")
HUTB E 0 A_Refire("Hold")
goto Fire2

Hold2:
HUTB G 0 A_PlaySoundEx("weapon/lflcharge","Weapon")

Hold2.a:
HUTB G 1 ACS_ExecuteAlways(998,0,12009,6)
HUTB G 0 A_GiveInventory("WeaponCharge_MaestroRC",1)//76
HUTB G 0 A_JumpIfInventory("WeaponCharge",76,"Hold3")
HUTB G 0 A_Refire("Hold2.b")
goto Fire2

Hold2.b:
HUTB E 1 ACS_ExecuteAlways(998,0,12001,1)
HUTB E 0 A_GiveInventory("WeaponCharge_MaestroRC",1)//76
HUTB E 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB E 0 A_JumpIfInventory("WeaponCharge",76,"Hold3")
HUTB E 0 A_Refire("Hold2.a")
goto Fire2

Hold3:
HUTB H 0 A_PlaySoundEx("weapon/lflready","Body")

Hold3.a:
HUTB H 1 ACS_ExecuteAlways(998,0,12010,7)
HUTB H 0 A_Refire("Hold3.b")
goto Fire3

Hold3.b:
HUTB E 1 ACS_ExecuteAlways(998,0,12001,1)
HUTB E 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB E 0 A_Refire("Hold3.a")
goto Fire3

Altfire:
HUTB E 1 A_JumpIfInventory("MaestroShieldCount",36,1)
goto Ready2+1
HUTB E 0 A_PlaySoundEx("weapon/maestroshield","Weapon")
HUTB E 1 Offset(-9,23)
HUTB E 1 Offset(-18,14)
HUTB E 0 A_SpawnItemEx("MaestroShieldSparkleFX",32,0,28,0,0,0,0,1,0)
Altfire2:
HUST KK 0 A_SpawnItemEx("MaestroShieldAbsorb",56,0,2,momx,momy,momz,0,9,0)
HUST K 0 A_SpawnItemEx("MaestroShieldFX",56,0,2,momx,momy,momz,0,9,0)
HUST K 1 Offset(-27,5)A_TakeInventory("MaestroShieldCount",1)
HUST K 0 A_JumpIfInventory("MaestroShieldCount",1,1)
goto AltfireEnd
HUST K 0 A_Refire("Altfire2")
goto AltfireEnd

AltfireEnd:
HUTB E 1 Offset(-18,14)
HUTB E 1 Offset(-9,23)
HUTB E 18 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
HUTB E 0 A_Refire("Altfire")
goto Ready2+1

Reload:
HUTB E 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
HUTB E 1 Offset(40,92)A_TakeInventory("Once",9)
HUTB E 1 Offset(20,62)A_GiveInventory("MaestroNeutralBoss",1)
TNT1 A 3 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
TNT1 A 0 A_TakeInventory("MegaWaterSWepCMaestro")
HUTU J 1 Offset(-43,107)
HUTU J 1 Offset(-21,72)
HUTU J 2 Offset(15,32)
HUTU I 2 Offset(15,32)
HUTU H 1 Offset(15,32)A_TakeInventory("MaestroShieldCount",18)
HUTU H 1 Offset(15,32)A_TakeInventory("MaestroShieldCount",18)
HUTU G 1 Offset(15,32)A_TakeInventory("MaestroShieldCount",18)
HUTU G 1 Offset(15,32)A_TakeInventory("MaestroShieldCount",18)
HUTU F 1 Offset(15,32)A_TakeInventory("MaestroShieldCount",18)
HUTU F 1 Offset(15,32)A_TakeInventory("MaestroShieldCount",18)
HUSS F 0 A_PlaySoundEx("weapon/MaestroFuzz","Weapon")
HUSS GFGFGFDEDEDECBA 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
TNT1 A 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
Reload2:
TNT1 A 1 ACS_NamedExecuteAlways("CCBM_MaestroStyleChangeRevert",0)
TNT1 A 8
loop
}
}

actor AquaShieldPickup : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_GiveInventory("MaestroAquaShield",1)
TNT1 A 0 A_GiveInventory("MegaWaterSWepCMaestro",1)
TNT1 A 0 A_JumpIfInventory("AquaShieldChecker",1,"No")

TNT1 A 0 A_GiveInventory("AquaShieldChecker",1)
TNT1 A 0 A_GiveInventory("MegaWaterSCopyAmmo",28)
stop
No:
TNT1 A 0
stop
}
}

actor MegaWaterSWepCMaestro : MegaWaterSWepC{Weapon.AmmoGive 0}

actor MaestroElecShield : BaseMM8BDMWep_CBM
{
tag "$TAGC_0C11"
dropitem "CopyClassUpgradeDropped"

weapon.preferredskin "Maestro-Shield"
Weapon.SlotNumber 1
Obituary "$OB_ROCKBUSTER"
Inventory.Pickupmessage "You got Maestro.exe!"
weapon.ammotype "EXEAmmo"
inventory.pickupsound ""
inventory.icon "MaesESIc"
States
{
ThumbsUp:  
HUTB I 2 Offset(20,62)
HUTB I 2 Offset(40,92) 
HUST Y 2 Offset(-30,102)A_PlaySoundEx("weapon/RockThumbsUp","Weapon")
HUST Y 0 A_Refire(1)
HUST Y 2 Offset(-15,67)
HUST Y 2 Offset(1,31)
goto ThumbsUpH
ThumbsUpH:
HUST Y 1 Offset(1,31)A_RailWait
HUST Y 0 A_JumpIfInventory("MaestroBusterFlag",1,"ThumbsUpH")
goto ThumbsUpEnd
ThumbsUpEnd:
HUST Y 2 Offset(-15,67)
HUST Y 2 Offset(-30,102) 
HUTB I 2 Offset(40,92)
HUTB I 2 Offset(20,62)
goto Ready2+1

Spawn:
C_00 C 1
loop

Ready:
HUTB I 0 A_JumpIfInventory("Once",1,"ReadyNoIntro")
Goto ReadyIntro

Ready2:
HUTB I 0 ACS_ExecuteAlways(998,0,12002,1)
HUTB I 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB I 0 A_JumpIfInventory("MaestroBusterFlag",1,"ThumbsUp")
HUTB I 1 A_WeaponReady(WRF_ALLOWRELOAD)
Goto Ready2+1

Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
HUTB I 1 A_Lower
Loop

Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
HUTB I 1 A_Raise
Loop

ReadyIntro:
HUSS K 0 ACS_NamedExecuteAlways("CCBM_MaestroStyleChangeEnd",0,15)
HUSS K 0 A_PlaySoundEx("weapon/lflready","Weapon")
HUSS K 0 ACS_ExecuteAlways(998,0,12002,1)
HUSS K 0 ACS_ExecuteAlways(991,0,12002)
HUTU K 1 Offset(-6,41)A_GiveInventory("MaestroShieldCount",18)
TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("CentaurFlashCFX",0,0,28,22,0,random2(256/12),random(0,359),1)
HUTU L 1 Offset(-12,50)A_GiveInventory("MaestroShieldCount",18)
HUTU M 1 Offset(-18,59)A_GiveInventory("MaestroShieldCount",18)
HUTU N 1 Offset(-24,68)A_GiveInventory("MaestroShieldCount",18)
HUTU O 0 Offset(-30,77)A_GiveInventory("Once",1)
HUTU O 1 Offset(-30,77)A_GiveInventory("MaestroShieldCount",18)
HUTU O 1 Offset(-30,77)A_GiveInventory("MaestroShieldCount",18)
HUTU O 4 Offset(-30,77)
HUTU O 1 Offset(-24,68)
HUTU O 1 Offset(-18,59)
HUTU O 1 Offset(-12,50)
HUTU O 1 Offset(-6,41)
HUTU O 6 Offset(0,32)
HUTU O 1 Offset(-21,72)
HUTU O 1 Offset(-43,107)
TNT1 A 3 Offset(40,92)
HUTB I 1 Offset(40,92)
HUTB I 1 Offset(20,62)
HUTB I 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
goto Ready2+1

ReadyNoIntro:
HUTB I 1 ACS_ExecuteAlways(998,0,12002,1)
goto Ready2+1


Fire:
HUTB J 0 A_JumpIfInventory("MaestroShieldAmmo",10,"FireEX")
HUTB J 0 A_JumpIfInventory("PowerRage_ST",1,"FireR")
HUTB J 0 ACS_ExecuteAlways(998,0,12002,1)
HUTB J 0 A_PlaySoundEx("weapon/RockBuster","Weapon")
HUTB J 0 A_TakeInventory("WeaponCharge",999)
HUTB J 0 A_GiveInventory("MaestroMain_CI",1)
HUTB J 1 Offset(5, 37)//41
HUTB J 1 Offset(9, 41)//45
HUTB J 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB J 1 Offset(10, 42)//46
HUTB I 1 Offset(9, 41)//45
HUTB I 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB I 1 Offset(5, 37)//41
HUTB I 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
HUTB I 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB I 2 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
HUTB I 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB I 0 A_Refire("Hold")
HUTB I 0 ACS_NamedExecuteAlways("BULL_SetState",0,2)
goto Ready2+1

FireR:
HUTB J 0 ACS_ExecuteAlways(998,0,12002,1)
HUTB J 0 A_PlaySoundEx("weapon/RockBuster","Weapon")
HUTB J 0 A_TakeInventory("WeaponCharge",999)
HUTB J 0 A_GiveInventory("MaestroMain_CI",1)
HUTB J 1 Offset(5, 37)//41
HUTB J 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB J 1 Offset(10, 42)//46
HUTB I 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB I 1 Offset(5, 37)//41
HUTB I 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
HUTB I 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB I 0 A_Refire("Hold")
HUTB I 0 ACS_NamedExecuteAlways("BULL_SetState",0,2)
goto Ready2+1

Fire2:
HUTB I 1 A_StopSoundEx("Weapon")
goto Fire

Fire3:
HUTB L 0 ACS_ExecuteAlways(998,0,12002,1)
HUTB L 0 A_StopSoundEx("Body")
HUTB L 1 Offset(-9,23)
HUTB I 1 Offset(-18,14)
HUTB L 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB L 0 A_PlaySoundEx("weapon/ElecTeleport","Weapon")
HUTB L 0 A_PlaySoundEx("weapon/TSTRIKE","SoundSlot6")
HUTB L 0 A_TakeInventory("WeaponCharge",999)
HUTB L 1 Offset(-18,10)A_GiveInventory("MaestroElecMain_CI",1)
HUTB I 1 Offset(-18,14)
HUTB I 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB L 1 Offset(-18,10)
HUTB I 1 Offset(-18,14)
HUTB I 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB L 1 Offset(-18,10)
HUTB I 1 Offset(-18,14)
HUTB I 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB L 1 Offset(-18,10)
HUTB I 1 Offset(-18,14)
HUTB I 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB L 1 Offset(-18,10)
HUTB I 1 Offset(-18,14)
HUTB I 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB I 1 Offset(-18,14)
HUTB I 1 Offset(-9,23)
HUTB I 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB I 2 A_WeaponReady(14)
HUTB I 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB I 2 A_WeaponReady(14)
HUTB I 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB I 2 A_WeaponReady(14)
HUTB I 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB I 2 A_WeaponReady(14)
HUTB I 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB I 1 A_WeaponReady(14)
HUTB I 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB I 0 A_Refire("Hold")
goto Ready2+1

FireEX:
HUTB L 0 ACS_ExecuteAlways(998,0,12002,1)
HUTB L 1 Offset(-9,23)
HUTB I 1 Offset(-18,14)
HUTB L 0 A_PlaySoundEx("weapon/ElecTeleport","Weapon")
HUTB L 0 A_PlaySoundEx("weapon/TSTRIKE","SoundSlot6")
HUTB L 0 A_TakeInventory("WeaponCharge",999)
HUTB L 1 Offset(-18,10)A_GiveInventory("MaestroElecShieldMain_CI",1)
HUTB L 0 Offset(-18,10)A_TakeInventory("MaestroShieldAmmo",2)
HUTB I 1 Offset(-18,14)
HUTB I 0 Offset(-18,14)A_TakeInventory("MaestroShieldAmmo",2)
HUTB L 1 Offset(-18,10)
HUTB L 0 Offset(-18,10)A_TakeInventory("MaestroShieldAmmo",2)
HUTB I 1 Offset(-18,14)
HUTB I 0 Offset(-18,14)A_TakeInventory("MaestroShieldAmmo",2)
HUTB L 1 Offset(-18,10)
HUTB L 0 Offset(-18,10)A_TakeInventory("MaestroShieldAmmo",2)
HUTB I 1 Offset(-18,14)
HUTB I 1 Offset(-9,23)
HUTB I 9 A_WeaponReady(14)
HUTB I 0 A_Refire("Hold")
goto Ready2+1

Hold:
HUTB I 1 A_JumpIfInventory("MaestroShieldAmmo",10,"FireEX")
HUTB I 0 A_GiveInventory("WeaponCharge_MaestroRC",1)
HUTB I 0 A_JumpIfInventory("WeaponCharge",9,"Hold2")
HUTB I 0 A_Refire("Hold.b")
goto Fire2

Hold.b:
HUTB I 1 A_JumpIfInventory("MaestroShieldAmmo",10,"FireEX")
HUTB I 0 A_GiveInventory("WeaponCharge_MaestroRC",1)
HUTB I 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB I 0 A_JumpIfInventory("WeaponCharge",9,"Hold2")
HUTB I 0 A_Refire("Hold")
goto Fire2

Hold2:
HUTB K 0 A_PlaySoundEx("weapon/lflcharge","Weapon")

Hold2.a:
HUTB K 1 ACS_ExecuteAlways(998,0,12011,6)
HUTB K 0 A_GiveInventory("WeaponCharge_MaestroRC",1)//76
HUTB K 0 A_JumpIfInventory("WeaponCharge",76,"Hold3")
HUTB K 0 A_Refire("Hold2.b")
goto Fire2

Hold2.b:
HUTB I 1 ACS_ExecuteAlways(998,0,12002,1)
HUTB I 0 A_GiveInventory("WeaponCharge_MaestroRC",1)//76
HUTB I 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB I 0 A_JumpIfInventory("WeaponCharge",76,"Hold3")
HUTB I 0 A_Refire("Hold2.a")
goto Fire2

Hold3:
HUTB L 0 A_PlaySoundEx("weapon/lflready","Body")

Hold3.a:
HUTB L 1 ACS_ExecuteAlways(998,0,12012,7)
HUTB L 0 A_Refire("Hold3.b")
goto Fire3

Hold3.b:
HUTB I 1 ACS_ExecuteAlways(998,0,12002,1)
HUTB I 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB I 0 A_Refire("Hold3.a")
goto Fire3

Altfire:
HUTB I 1 A_JumpIfInventory("MaestroShieldCount",36,1)
goto Ready2+1
HUTB I 0 A_PlaySoundEx("weapon/maestroshield","Weapon")
HUTB I 1 Offset(-9,23)
HUTB I 1 Offset(-18,14)
HUST O 0 A_SpawnItemEx("MaestroShieldSparkleFX",32,0,28,0,0,0,0,1,0)
Altfire2:
HUST OO 0 A_SpawnItemEx("MaestroShieldAbsorb",56,0,2,momx,momy,momz,0,9,0)
HUST O 0 A_SpawnItemEx("MaestroShieldFX",56,0,2,momx,momy,momz,0,9,0)
HUST O 1 Offset(-27,5)A_TakeInventory("MaestroShieldCount",1)
HUST O 0 A_JumpIfInventory("MaestroShieldCount",1,1)
goto AltfireEnd
HUST O 0 A_Refire("Altfire2")
goto AltfireEnd

AltfireEnd:
HUTB I 1 Offset(-18,14)
HUTB I 1 Offset(-9,23)
HUTB I 18 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
HUTB I 0 A_Refire("Altfire")
goto Ready2+1

Reload:
HUTB I 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
HUTB I 1 Offset(40,92)A_TakeInventory("Once",9)
HUTB I 1 Offset(20,62)A_GiveInventory("MaestroNeutralBoss",1)
TNT1 A 3 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
TNT1 A 0 A_TakeInventory("DarkShieldWepCMaestro")
HUTU O 1 Offset(-43,107)
HUTU O 1 Offset(-21,72)
HUTU O 2 Offset(15,32)
HUTU N 2 Offset(15,32)
HUTU M 1 Offset(15,32)A_TakeInventory("MaestroShieldCount",18)
HUTU M 1 Offset(15,32)A_TakeInventory("MaestroShieldCount",18)
HUTU L 1 Offset(15,32)A_TakeInventory("MaestroShieldCount",18)
HUTU L 1 Offset(15,32)A_TakeInventory("MaestroShieldCount",18)
HUTU K 1 Offset(15,32)A_TakeInventory("MaestroShieldCount",18)
HUTU K 1 Offset(15,32)A_TakeInventory("MaestroShieldCount",18)
HUSS K 0 A_PlaySoundEx("weapon/MaestroFuzz","Weapon")
HUSS GFGFGFDEDEDECBA 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
TNT1 A 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
Reload2:
TNT1 A 1 ACS_NamedExecuteAlways("CCBM_MaestroStyleChangeRevert",0)
TNT1 A 8
loop
}
}

actor MaestroElecShotS : MaestroElecShot
{
damagetype "MaestroShock2"
}

actor MaestroElecShotSB : MaestroElecShotS{Translation "192:192=205:205","198:198=74:74","202:202=205:205"}
actor MaestroElecShotSR : MaestroElecShotS{Translation "192:192=54:54","198:198=41:41","202:202=54:54"}
actor MaestroElecShotSO : MaestroElecShotS{Translation "192:192=104:104","198:198=128:128","202:202=104:104"}
actor MaestroElecShotSP : MaestroElecShotS{Translation "192:192=229:229","198:198=232:232","202:202=229:229"}

actor MaestroElecShieldMain_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("MaestroElecShotS",0,0,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("MaestroElecShotSB",0,0,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("MaestroElecShotSR",0,0,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("MaestroElecShotSO",0,0,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("MaestroElecShotSP",0,0,8,0)
goto Done
}
}

actor ElecShieldPickup : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_GiveInventory("MaestroElecShield",1)
TNT1 A 0 A_GiveInventory("DarkShieldWepCMaestro",1)
TNT1 A 0 A_JumpIfInventory("ElecShieldChecker",1,"No")

TNT1 A 0 A_GiveInventory("ElecShieldChecker",1)
TNT1 A 0 A_GiveInventory("DarkShieldAmmo",28)
stop
No:
TNT1 A 0
stop
}
}

actor DarkShieldWepCMaestro : DarkShieldWepC{Weapon.AmmoGive 0}

actor MaestroWoodShield : BaseMM8BDMWep_CBM
{
tag "$TAGC_0C12"
dropitem "CopyClassUpgradeDropped"

weapon.preferredskin "Maestro-Shield"
Weapon.SlotNumber 1
Obituary "$OB_ROCKBUSTER"
Inventory.Pickupmessage "You got Maestro.exe!"
weapon.ammotype "EXEAmmo"
inventory.pickupsound ""
inventory.icon "MaesWSIc"
States
{
ThumbsUp:  
HUTB M 2 Offset(20,62)
HUTB M 2 Offset(40,92) 
HUST V 2 Offset(-30,102)A_PlaySoundEx("weapon/RockThumbsUp","Weapon")
HUST V 0 A_Refire(1)
HUST V 2 Offset(-15,67)
HUST V 2 Offset(1,31)
goto ThumbsUpH
ThumbsUpH:
HUST V 1 Offset(1,31)A_RailWait
HUST V 0 A_JumpIfInventory("MaestroBusterFlag",1,"ThumbsUpH")
goto ThumbsUpEnd
ThumbsUpEnd:
HUST V 2 Offset(-15,67)
HUST V 2 Offset(-30,102) 
HUTB M 2 Offset(40,92)
HUTB M 2 Offset(20,62)
goto Ready2+1

Spawn:
C_00 C 1
loop

Ready:
HUTB M 0 A_JumpIfInventory("Once",1,"ReadyNoIntro")
Goto ReadyIntro

Ready2:
HUTB M 0 ACS_ExecuteAlways(998,0,12003,1)
HUTB M 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB N 0 A_JumpIfInventory("MaestroBusterFlag",1,"ThumbsUp")
HUTB M 1 A_WeaponReady(WRF_ALLOWRELOAD)
Goto Ready2+1

Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
HUTB M 1 A_Lower
Loop

Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
HUTB M 1 A_Raise
Loop

ReadyIntro:
HUSS P 0 ACS_NamedExecuteAlways("CCBM_MaestroStyleChangeEnd",0,16)
HUSS P 0 A_PlaySoundEx("weapon/lflready","Weapon")
HUSS P 0 ACS_ExecuteAlways(998,0,12003,1)
HUSS P 0 ACS_ExecuteAlways(991,0,12003)
HUTU P 1 Offset(-6,41)A_GiveInventory("MaestroShieldCount",18)
TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("CentaurFlashCFX",0,0,28,22,0,random2(256/12),random(0,359),1)
HUTU Q 1 Offset(-12,50)A_GiveInventory("MaestroShieldCount",18)
HUTU R 1 Offset(-18,59)A_GiveInventory("MaestroShieldCount",18)
HUTU S 1 Offset(-24,68)A_GiveInventory("MaestroShieldCount",18)
HUTU T 0 Offset(-30,77)A_GiveInventory("Once",1)
HUTU T 1 Offset(-30,77)A_GiveInventory("MaestroShieldCount",18)
HUTU T 1 Offset(-30,77)A_GiveInventory("MaestroShieldCount",18)
HUTU T 4 Offset(-30,77)
HUTU T 1 Offset(-24,68)
HUTU T 1 Offset(-18,59)
HUTU T 1 Offset(-12,50)
HUTU T 1 Offset(-6,41)
HUTU T 6 Offset(0,32)
HUTU T 1 Offset(-21,72)
HUTU T 1 Offset(-43,107)
TNT1 A 3 Offset(40,92)
HUTB M 1 Offset(40,92)
HUTB M 1 Offset(20,62)
HUTB M 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
goto Ready2+1

ReadyNoIntro:
HUTB M 1 ACS_ExecuteAlways(998,0,12003,1)
goto Ready2+1


Fire:
HUTB N 0 A_JumpIfInventory("MaestroShieldAmmo",10,"FireEX")
HUTB N 0 A_JumpIfInventory("PowerRage_ST",1,"FireR")
HUTB N 0 ACS_ExecuteAlways(998,0,12003,1)
HUTB N 0 A_PlaySoundEx("weapon/RockBuster","Weapon")
HUTB N 0 A_TakeInventory("WeaponCharge",999)
HUTB N 0 A_GiveInventory("MaestroMain_CI",1)
HUTB N 1 Offset(5, 37)//41
HUTB N 1 Offset(9, 41)//45
HUTB N 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB N 1 Offset(10, 42)//46
HUTB M 1 Offset(9, 41)//45
HUTB M 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB M 1 Offset(5, 37)//41
HUTB M 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
HUTB M 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB M 2 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
HUTB M 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB M 0 A_Refire("Hold")
HUTB M 0 ACS_NamedExecuteAlways("BULL_SetState",0,2)
goto Ready2+1

FireR:
HUTB N 0 ACS_ExecuteAlways(998,0,12003,1)
HUTB N 0 A_PlaySoundEx("weapon/RockBuster","Weapon")
HUTB N 0 A_TakeInventory("WeaponCharge",999)
HUTB N 0 A_GiveInventory("MaestroMain_CI",1)
HUTB N 1 Offset(5, 37)//41
HUTB N 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB N 1 Offset(10, 42)//46
HUTB M 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB M 1 Offset(5, 37)//41
HUTB M 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
HUTB M 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB M 0 A_Refire("Hold")
HUTB M 0 ACS_NamedExecuteAlways("BULL_SetState",0,2)
goto Ready2+1

Fire2:
HUTB M 1 A_StopSoundEx("Weapon")
goto Fire

Fire3:
HUTB P 0 ACS_ExecuteAlways(998,0,12003,1)
HUTB P 0 A_StopSoundEx("Body")
HUTB P 1 Offset(-9,23)
HUTB M 1 Offset(-18,14)
HUTB P 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB P 0 A_PlaySoundEx("class/windstart","Weapon")
HUTB P 0 A_PlaySoundEx("weapon/TopManShot","SoundSlot6")
HUTB P 0 A_TakeInventory("WeaponCharge",999)
HUTB P 1 Offset(-18,10)A_GiveInventory("MaestroWoodMainAlt_CI",1)
HUTB M 1 Offset(-18,14)
HUTB M 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB P 1 Offset(-18,10)
HUTB M 1 Offset(-18,14)
HUTB M 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB P 1 Offset(-18,10)
HUTB M 1 Offset(-18,14)
HUTB M 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB P 1 Offset(-18,10)
HUTB M 1 Offset(-18,14)
HUTB M 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB P 1 Offset(-18,10)A_GiveInventory("MaestroWoodMain_CI",1)
HUTB M 1 Offset(-18,14)
HUTB M 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB M 1 Offset(-18,14)
HUTB M 1 Offset(-9,23)
HUTB M 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB M 2 A_WeaponReady(14)
HUTB M 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB M 2 A_WeaponReady(14)
HUTB M 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB M 2 A_WeaponReady(14)
HUTB M 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB M 2 A_WeaponReady(14)
HUTB M 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB M 1 A_WeaponReady(14)
HUTB M 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB M 0 A_Refire("Hold")
goto Ready2+1

FireEX:
HUTB P 0 ACS_ExecuteAlways(998,0,12003,1)
HUTB P 1 Offset(-9,23)
HUTB M 1 Offset(-18,14)
HUTB M 0 A_PlaySoundEx("class/windstart","Weapon")
HUTB M 0 A_PlaySoundEx("weapon/TopManShot","SoundSlot6")
HUTB M 0 A_TakeInventory("WeaponCharge",999)
HUTB P 1 Offset(-18,10)A_GiveInventory("MaestroWoodMain_CI",1)
HUTB P 0 Offset(-18,10)A_TakeInventory("MaestroShieldAmmo",2)
HUTB M 1 Offset(-18,14)
HUTB M 0 Offset(-18,14)A_TakeInventory("MaestroShieldAmmo",2)
HUTB P 1 Offset(-18,10)
HUTB P 0 Offset(-18,10)A_TakeInventory("MaestroShieldAmmo",2)
HUTB M 1 Offset(-18,14)
HUTB M 0 Offset(-18,14)A_TakeInventory("MaestroShieldAmmo",2)
HUTB P 1 Offset(-18,10)
HUTB P 0 Offset(-18,10)A_TakeInventory("MaestroShieldAmmo",2)
HUTB M 1 Offset(-18,14)
HUTB M 1 Offset(-9,23)
HUTB M 9 A_WeaponReady(14)
HUTB M 0 A_Refire("Hold")
goto Ready2+1

Hold:
HUTB M 1 A_JumpIfInventory("MaestroShieldAmmo",10,"FireEX")
HUTB M 0 A_GiveInventory("WeaponCharge_MaestroRC",1)
HUTB M 0 A_JumpIfInventory("WeaponCharge",9,"Hold2")
HUTB M 0 A_Refire("Hold.b")
goto Fire2

Hold.b:
HUTB M 1 A_JumpIfInventory("MaestroShieldAmmo",10,"FireEX")
HUTB M 0 A_GiveInventory("WeaponCharge_MaestroRC",1)
HUTB M 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB M 0 A_JumpIfInventory("WeaponCharge",9,"Hold2")
HUTB M 0 A_Refire("Hold")
goto Fire2

Hold2:
HUTB O 0 A_PlaySoundEx("weapon/lflcharge","Weapon")

Hold2.a:
HUTB O 1 ACS_ExecuteAlways(998,0,12013,6)
HUTB O 0 A_GiveInventory("WeaponCharge_MaestroRC",1)//76
HUTB O 0 A_JumpIfInventory("WeaponCharge",76,"Hold3")
HUTB O 0 A_Refire("Hold2.b")
goto Fire2

Hold2.b:
HUTB M 1 ACS_ExecuteAlways(998,0,12003,1)
HUTB M 0 A_GiveInventory("WeaponCharge_MaestroRC",1)//76
HUTB M 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB M 0 A_JumpIfInventory("WeaponCharge",76,"Hold3")
HUTB M 0 A_Refire("Hold2.a")
goto Fire2

Hold3:
HUTB P 0 A_PlaySoundEx("weapon/lflready","Body")

Hold3.a:
HUTB P 1 ACS_ExecuteAlways(998,0,12014,7)
HUTB P 0 A_Refire("Hold3.b")
goto Fire3

Hold3.b:
HUTB M 1 ACS_ExecuteAlways(998,0,12003,1)
HUTB M 0 A_GiveInventory("MaestroShieldCount_RC",1)
HUTB M 0 A_Refire("Hold3.a")
goto Fire3

Altfire:
HUTB M 1 A_JumpIfInventory("MaestroShieldCount",36,1)
goto Ready2+1
HUTB M 0 A_PlaySoundEx("weapon/maestroshield","Weapon")
HUTB M 1 Offset(-9,23)
HUTB M 1 Offset(-18,14)
HUST S 0 A_SpawnItemEx("MaestroShieldSparkleFX",32,0,28,0,0,0,0,1,0)
Altfire2:
HUST SS 0 A_SpawnItemEx("MaestroShieldAbsorb",56,0,2,momx,momy,momz,0,9,0)
HUST S 0 A_SpawnItemEx("MaestroShieldFX",56,0,2,momx,momy,momz,0,9,0)
HUST S 1 Offset(-27,5)A_TakeInventory("MaestroShieldCount",1)
HUST S 0 A_JumpIfInventory("MaestroShieldCount",1,1)
goto AltfireEnd
HUST S 0 A_Refire("Altfire2")
goto AltfireEnd

AltfireEnd:
HUTB M 1 Offset(-18,14)
HUTB M 1 Offset(-9,23)
HUTB M 18 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
HUTB M 0 A_Refire("Altfire")
goto Ready2+1

Reload:
HUTB M 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
HUTB M 1 Offset(40,92)A_TakeInventory("Once",9)
HUTB M 1 Offset(20,62)A_GiveInventory("MaestroNeutralBoss",1)
TNT1 A 3 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
TNT1 A 0 A_TakeInventory("LeafShieldWepCMaestro")//nice job mgo
HUTU T 1 Offset(-43,107)
HUTU T 1 Offset(-21,72)
HUTU T 2 Offset(15,32)
HUTU S 2 Offset(15,32)
HUTU R 1 Offset(15,32)A_TakeInventory("MaestroShieldCount",18)
HUTU R 1 Offset(15,32)A_TakeInventory("MaestroShieldCount",18)
HUTU Q 1 Offset(15,32)A_TakeInventory("MaestroShieldCount",18)
HUTU Q 1 Offset(15,32)A_TakeInventory("MaestroShieldCount",18)
HUTU P 1 Offset(15,32)A_TakeInventory("MaestroShieldCount",18)
HUTU P 1 Offset(15,32)A_TakeInventory("MaestroShieldCount",18)
HUSS P 0 A_PlaySoundEx("weapon/MaestroFuzz","Weapon")
HUSS GFGFGFDEDEDECBA 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
TNT1 A 1 A_WeaponReady(WRF_NOFIRE | WRF_NOSWITCH)
Reload2:
TNT1 A 1 ACS_NamedExecuteAlways("CCBM_MaestroStyleChangeRevert",0)
TNT1 A 8
loop
}
}

actor WoodShieldPickup : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_GiveInventory("MaestroWoodShield",1)
TNT1 A 0 A_GiveInventory("LeafShieldWepCMaestro",1)
TNT1 A 0 A_JumpIfInventory("WoodShieldChecker",1,"No")

TNT1 A 0 A_GiveInventory("WoodShieldChecker",1)
TNT1 A 0 A_GiveInventory("LeafShieldAmmo",28)
stop
No:
TNT1 A 0
stop
}
}
