actor GreatBusterBossWeapon : MegaBuster
{
tag "Great Buster"
Weapon.AmmoUse 0
Weapon.AmmoGive 0
Weapon.SlotNumber 1
Obituary "$OB_GREATBUSTER1"
+INVENTORY.UNDROPPABLE
weapon.ammotype "BossJumpChargeBX"
weapon.ammotype2 "BossRageCharge"
+WEAPON.AMMO_OPTIONAL
Scale 2.0
States
{
Spawn:
TNT1 A 0
stop
Ready:
BSXB A 0 ACS_NamedExecuteAlways("GiveExecution",0)
BSXB A 0 A_GiveInventory("BeginUser_Buddha",1)
BSXB A 0 ACS_ExecuteAlways(808,0)
BSXB A 0 ACS_ExecuteAlways(998,0,541)
BSXB A 1
Goto Ready1
Ready1:
BSXB A 0 A_JumpIfHealthLower(ACS_ExecuteWithResult(U_BOSS_GETINVENTORY,1)*0.20+1,"ReadyXStart")
BSXB A 0 ACS_ExecuteAlways(991,0,541)
BSXB A 0 A_GiveInventory("NormalPower",1)
BSXB A 1 A_WeaponReady(WRF_NOSWITCH)
BSXB A 1 
Goto Ready1
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
BSXB A 1 A_Lower
loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
BSXB A 1 A_Raise
Loop
Fire:
BSXB A 0 A_JumpIfInventory("TruePowerFlag",1,"FireX")
BSXB A 0 A_PlaySoundEx("weapon/mbuster","Weapon")
BSXB A 0 A_FireCustomMissile("GreatShot",0,1,8,0)
BSXB BCBB 2
BSXB A 12
BSXB A 0 A_JumpIfHealthLower(ACS_ExecuteWithResult(U_BOSS_GETINVENTORY,1)*0.20+1,"ReadyXStart")
BSXB A 0 A_Refire
Goto Ready1
FireX:
BSXB D 0 A_PlaySoundEx("weapon/mbuster","Weapon")
BSXB D 0 A_FireCustomMissile("GreatShotX",0,1,8,0)
BSXB EFFFFFFEEE 2
BSXB D 4
BSXB D 0 A_Refire
Goto ReadyX
Altfire:
BSXB A 0 A_JumpIfInventory("TruePowerFlag",1,"AltfireX")
BSXB A 1 A_JumpIfInventory("BossJumpChargeBX",125,1)
Goto Ready1
BSXB B 0 A_PlaySoundEx("weapon/mbuster","Weapon")
BSXB B 0 A_TakeInventory("BossJumpChargeBX",125)
BSXB B 0 A_FireCustomMissile("ExpertBusterShot",random(-2,2),0,8,0)
BSXB B 0 A_ChangeVelocity(-Cos(pitch)*17, 0, sin(pitch)*16,CVF_RELATIVE)//12,10
BSXB B 0 
BSXB BCB 2
BSXB A 1
Goto Ready1
AltfireX:
BSXB D 1 A_JumpIfInventory("BossJumpChargeBX",125,1)
goto ReadyX
BSXB D 2
BSXB B 0 A_TakeInventory("BossJumpChargeBX",125)
BSXB D 0 A_ChangeFlag("NOGRAVITY",1)
BSXB D 0 A_PlaySoundEx("weapon/pshot","Weapon")
BSXB D 0 A_FireCustomMissile("ExpertBusterShotX",0,0,8,0)
BSXB B 0 A_ChangeVelocity(-Cos(pitch)*8, 0, sin(pitch)*8,CVF_RELATIVE)//12,10
BSXB EFE 2
BSXB D 0 A_PlaySoundEx("weapon/pshot","Weapon")
BSXB D 0 A_FireCustomMissile("ExpertBusterShotX",-3,0,8,0)
BSXB D 0 A_FireCustomMissile("ExpertBusterShotX",3,0,8,0)
BSXB B 0 A_ChangeVelocity(-Cos(pitch)*8, 0, sin(pitch)*8,CVF_RELATIVE)//12,10
BSXB EFE 2
BSXB D 0 A_PlaySoundEx("weapon/pshot","Weapon")
BSXB D 0 A_FireCustomMissile("ExpertBusterShotX",-7,0,8,0)
BSXB D 0 A_FireCustomMissile("ExpertBusterShotX",7,0,8,0)
BSXB B 0 A_ChangeVelocity(-Cos(pitch)*8, 0, sin(pitch)*8,CVF_RELATIVE)//12,10
BSXB EFE 2
BSXB D 0 SetPlayerProperty(0,0,0)
BSXB D 0 A_ChangeFlag("NOGRAVITY",0)
BSXB D 17
goto ReadyX
NoAmmo:
SXH1 D 1 ACS_Execute(979,0)
SXH1 D 0 A_Refire
Goto Ready1
ReadyX:
BSXB D 0 //A_GunFlash//("RageFlash")
BSXB D 0 A_TakeInventory("NormalPower",1)
BSXB D 0 A_GiveInventory("TruePowerFlag",1)
BSXB D 0 ACS_ExecuteAlways(991,0,542)
BSXB D 1 A_WeaponReady(WRF_NOSWITCH)
BSXB D 1 
Goto ReadyX
ReadyXStart:
BSXB A 0 ACS_NamedExecuteAlways("BEMusicShift",0)
BSXB A 0 A_Changeflag("INVULNERABLE",1)
TNT1 A 0 A_PlaySound("item/energyup")
BSXB A 1 ACS_ExecuteAlways(991,0,541)
TNT1 A 0 A_JumpIfHealthLower(ACS_ExecuteWithResult(U_BOSS_GETINVENTORY,1) * 0.25,"GiveHealth1")
BSXB A 0 A_Changeflag("INVULNERABLE",0)
BSXB A 0 A_GiveInventory("BuddhaOff_P",1)
SMAM A 0 SetPlayerProperty(0,0,16)
BSXB D 0 A_TakeInventory("NormalPower",1)
BSXB D 0 A_GiveInventory("TruePowerFlag",1)
BSXB D 0 ACS_ExecuteAlways(991,0,542)
BSXB D 1 A_WeaponReady(WRF_NOSWITCH)
BSXB D 1 A_GiveInventory("JumpChargeSpeed0",1)
BSXB D 0 A_PlaySoundEx("Buster/ShinyUp","SoundSlot1",0,0)
BSXB D 1 A_GiveInventory("ShinySparkleItem",1)
Goto ReadyX
ReadyXStart2:
BSXB A 0 ACS_NamedExecuteAlways("BEMusicShift",0)
BSXB A 0 A_Changeflag("INVULNERABLE",1)
BSXB A 0 A_GunFlash//("RageFlash")
TNT1 A 0 A_PlaySound("item/energyup")
BSXB D 1 ACS_ExecuteAlways(991,0,542)
TNT1 A 0 A_JumpIfHealthLower(ACS_ExecuteWithResult(U_BOSS_GETINVENTORY,1) * 0.25,"GiveHealth2")
BSXB A 0 A_Changeflag("INVULNERABLE",0)
BSXB A 0 A_GiveInventory("BuddhaOff_P",1)
SMAM A 0 SetPlayerProperty(0,0,16)
BSXB D 0 A_TakeInventory("NormalPower",1)
BSXB D 0 A_GiveInventory("TruePowerFlag",1)
BSXB D 0 ACS_ExecuteAlways(991,0,542)
BSXB D 1 A_WeaponReady(WRF_NOSWITCH)
BSXB D 1 A_GiveInventory("JumpChargeSpeed0",1)
BSXB D 0 A_PlaySoundEx("Buster/ShinyUp","SoundSlot1",0,0)
BSXB D 1 A_GiveInventory("ShinySparkleItem",1)
Goto ReadyX
GiveHealth1:
TNT1 A 0 ACS_ExecuteAlways(U_HEALTHACS,0,7,4)
goto ReadyXStart2+1
GiveHealth2:
TNT1 A 0 ACS_ExecuteAlways(U_HEALTHACS,0,7,4)
goto ReadyXStart+1
}
}

actor GreatShot
{
gravity 1.5
Translation "192:192=86:86", "198:198=94:94", "199:199=87:87", "202:202=4:4"
PROJECTILE
damagetype "GreatBuster"
Obituary "$OB_GREATBUSTER1"
+SKYEXPLODE
Damage (10)
Speed 40
radius 20
height 20
scale 3.0
States
{
Spawn:
X_0A A 0
X_0A A 0 A_SetPitch(10) 
X_0A ABC 2
Y_0A B 2 A_SetPitch(pitch-1)
X_0A CB 2
Y_0A C 2
X_0A A 0 A_ChangeFlag("NOGRAVITY",0)
MXP1 D -1
wait
Death:
TNT1 A 0 A_Stop
TNT1 A 0 A_PlaySoundEx("weapon/crackerexplode", "Weapon")
TNT1 A 0 A_Explode(5+pitch,148,0,0,40)
6P03 ABCDEFG 2
stop
}
}

actor ExpertBusterShot : GreatShot
{
Obituary "$OB_EXPERTBUSTER1"
Damage (15+pitch)
radius 18
height 18
scale 2.5
Speed 60
States
{
Spawn:
X_0A A 0
X_0A A 0 A_SetPitch(10) 
X_0A ABC 2
Y_0A B 2 A_SetPitch(pitch-1)
X_0A CB 2 
Y_0A C 2
goto Spawn+3
Death:
TNT1 A 0 A_Stop
TNT1 A 0 A_PlaySoundEx("weapon/crackerexplode", "Weapon")
TNT1 A 0 A_Explode(10,128,0,0,20)
6P03 ABCDEFG 2
stop
}
}

actor GreatShotX : GreatShot
{
Translation "192:192=211:211", "198:198=112:112", "199:199=106:106", "202:202=209:209"
Obituary "$OB_GREATBUSTER2"
Damage (15+pitch)//110
//Speed 60
radius 25//20
height 25//20
scale 3.5//3.0
States
{
Spawn:
X_0A A 0
X_0A A 0 A_SetPitch(20) 
X_0A ABC 2
Y_0A B 2 A_SetPitch(pitch-1)
X_0A CB 2 A_SetPitch(pitch-1)
Y_0A C 2 A_SetPitch(pitch-1)
X_0A A 0 A_ChangeFlag("NOGRAVITY",0)
MXP1 D -1
wait

Death:
TNT1 A 0 A_Stop
TNT1 A 0 A_PlaySoundEx("weapon/crackerexplode","Weapon")
TNT1 A 0 A_Explode(10+pitch,160,0,0,80)//(110,148,0,0,20)
6P03 ABCDEFG 2
stop
}
}

actor ExpertBusterShotX : GreatShotX
{
Speed 60
Obituary "$OB_EXPERTBUSTER2"
Damage (5+pitch)
radius 18
height 18
scale 2.5
States
{
Spawn:
X_0A A 0
X_0A A 0 A_SetPitch(10) 
X_0A ABC 2
Y_0A B 2 A_SetPitch(pitch-1)
X_0A CB 2
Y_0A C 2
goto Spawn+3
Death:
TNT1 A 0 A_Stop
TNT1 A 0 A_PlaySoundEx("weapon/crackerexplode", "Weapon")
TNT1 A 0 A_Explode(15,128,0,0,64)
6P03 ABCDEFG 2
stop
}
}

actor ShinySparkleItem : CustomInventory
{
States
{
Pickup:
TNT1 A 0
//TNT1 A 0 A_PlaySoundEx("","Voice")
TNT1 A 0 A_JumpIfInventory("ShinySparkleFlag",1,"No")
TNT1 A 0 A_GiveInventory("ShinySparkleFlag",1)
TNT1 A 0 //A_SpawnItemEx("ShinySparkleFX3",0,0,28,0,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("ShinySparkleHelper",0,0,16)
stop
No:
TNT1 A 0
stop
}
}

actor ShinySparkleFlag : OnceC {}

actor ShinySparkleHelper : BasicHelper
{
States
{
Spawn:
TNT1 A 0
TNT1 A 4
goto Sparkle
Sparkle:
TNT1 A 0
TNT1 A 3 A_GiveToTarget("ShinySparkleHelper_P",1)
TNT1 A 0 A_JumpIfInTargetInventory("IsDead",1,"Death")
TNT1 A 0 A_JumpIfInTargetInventory("ShinySparkleFlag",1,"Sparkle")
stop
}
}

actor ShinySparkleHelper_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_CheckFlag(CANTSEEK,"No")
goto Pickup1
Pickup1:
TNT1 A 0 A_SpawnItemEx("ShinySparkleFX",random(16,48),0,Random(16,48),0,0,0,random(20,340),33)
TNT1 A 0 A_SpawnItemEx("ShinySparkleFX1",random(16,48),0,Random(16,48),0,0,0,random(20,340),33)
stop
No:
TNT1 A 0
stop
}
}

actor ShinySparkleFX : BasicClientSide
{
//+CLIENTSIDEONLY
//+NOGRAVITY
//-SOLID
ReactionTime 7
Renderstyle "Translucent"
Alpha 0.95
//radius 2
//height 2
//Scale 2.5
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Jump(256,1,2,3,4,5,6,7,8,9,"Spawn4","Spawn5","Spawn6")
Spawn1:
X_2F ABC 2 bright A_CountDown
loop
Spawn2:
X_2F DEF 2 bright A_CountDown
loop
Spawn3:
X_2F XYZ 2 bright A_CountDown
loop
Spawn4:
X_2F ABC 2 bright
stop
Spawn5:
X_2F DEF 2 bright
stop
Spawn6:
X_2F XYZ 2 bright
stop
}
}
actor ShinySparkleFX1 : ShinySparkleFX{Scale 1.5}


actor ShinySparkleFX2 : ShinySparkleFX
{
States
{
Spawn4:
goto Spawn1
Spawn5:
goto Spawn2
Spawn6:
goto Spawn3
}
}

actor ShinySparkleFX3 : BasicClientSide
{
var int user_A;
reactiontime 18
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SetUserVar("user_A",random(0,20))
TNT1 A 0 A_SpawnItemEx("ShinySparkleFX2",10,0,30,2,0,3,user_A+15,37)
TNT1 A 0 A_SpawnItemEx("ShinySparkleFX2",20,0,20,4,0,2,user_A+10,37)
TNT1 A 0 A_SpawnItemEx("ShinySparkleFX2",30,0,10,6,0,1,user_A+5,37)
TNT1 A 0 A_SpawnItemEx("ShinySparkleFX2",40,0,0,8,0,0,user_A,37)
TNT1 A 0 A_SpawnItemEx("ShinySparkleFX2",30,0,-10,6,0,-1,user_A+5,37)
TNT1 A 0 A_SpawnItemEx("ShinySparkleFX2",20,0,-20,4,0,-2,user_A+10,37)
TNT1 A 0 A_SpawnItemEx("ShinySparkleFX2",10,0,-30,2,0,-3,user_A+15,37)
TNT1 A 0 A_SetUserVar("user_A",user_A+20)
TNT1 A 0 A_Countdown
goto Spawn+2
Death:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("ShinySparkleFX2",0,0,40,0,0,4,0,37)
TNT1 A 0 A_SpawnItemEx("ShinySparkleFX2",0,0,-40,0,0,-4,0,37)
stop
}
}
