actor BusterRodGBossWeapon : MegaBuster
{
tag "Duel Rod"
Weapon.AmmoUse 0
Weapon.AmmoGive 0
Weapon.SlotNumber 1
Obituary "$OB_DUELROD" // no bad intention lol. Look
// for Mudkip's obituary if you want more
+INVENTORY.UNDROPPABLE
weapon.ammotype "BossJumpCharge"
weapon.ammotype2 "BossRageCharge4"
+WEAPON.AMMO_OPTIONAL
Scale 2.0
States
{
Spawn:
TNT1 A 0
stop
Ready:
BROG O 0 ACS_NamedExecuteAlways("GiveExecution",0)
BROG O 0 ACS_ExecuteAlways(991,0,519)
BROG O 0 A_JumpIfInventory("GenesisUnitFakeHealth", 1, 2)
BROG O 0 A_Jump(256, 2)
BROG O 0 ACS_ExecuteAlways(991,0,522)
BROG O 1 A_WeaponReady(WRF_NOSWITCH)
Goto Ready+1
Fire:
Hold:
BROG O 0 
goto HyperRodPrepare
HyperRodPrepare:

HyperRod:
BROG P 1
BROG O 0// A_Refire
goto HyperRodAttack
HyperRodAttack:
BROG PS 2
BRGZ P 0 A_PlaySoundEx("misc/brgstaff","Weapon")
BROG S 0 A_PlaySoundEx("weapon/KnightShot", "Item")
BROG S 2 A_FireCustomMissile("BusterRodGHyperRod",0,1,8,0)
BROG S 0 SetPlayerProperty(0, 1, 0)
BROG S 0 A_CheckFloor("RodWaiting")
goto RodWaitingAir

HyperRodAttack:
BROG PS 2
BRGZ P 0 A_PlaySoundEx("misc/brgstaff","Weapon")
BROG S 0 A_PlaySoundEx("weapon/KnightShot", "Item")
BROG S 2 A_FireCustomMissile("BusterRodGHyperRod",0,1,8,0)
BROG S 0 SetPlayerProperty(0, 1, 0)
BROG S 0 A_CheckFloor("RodWaiting")
goto RodWaitingAir
RodWaiting:
BROG S 0 //A_GiveInventory("BusterRodGProtection", 999)
BROG S 0 A_GiveInventory("BRGRod", 1)
BROG S 0 A_JumpIfInventory("BusterRodGWait", 70, "RodEnd")
BROG S 0 A_JumpIfInventory("BusterRodGFree", 1, "RodEnd")
BROG S 1// A_Stop
BROG S 0 A_GiveInventory("BusterRodGWait", 1)
loop
RodWaitingAir:
BROG S 0 //A_GiveInventory("BusterRodGProtection", 999)
BROG S 0 A_GiveInventory("BRGRod", 1)
BROG S 0 A_JumpIfInventory("BusterRodGWait", 70, "RodEndAir")
BROG S 0 A_JumpIfInventory("BusterRodGFree", 1, "RodEndAir")
BROG S 1 //A_Stop
BROG S 0 A_GiveInventory("BusterRodGWait", 1)
loop
RodEndAir:
BROG S 0 A_Recoil(-30)
BROG S 0 ThrustThingZ(0,15,0,0)
RodEnd:
SuperFail: // u no charg rode enough
BROG S 0 //A_TakeInventory("BusterRodGProtection", 1)
BROG S 0 A_TakeInventory("BRGRod", 999)
BROG S 0 A_TakeInventory("BusterRodGWait", 999)
BROG S 0 A_TakeInventory("BusterRodGFree", 999)
BROG S 0 SetPlayerProperty(0, 0, 0)
BROG S 0 //A_TakeInventory("BusterRodGProtection", 999)
BROG S 12
BROG P 3
BROG O 5
Goto Ready+1

HyperRodSP:
BROG Q 1
BROG O 0 A_JumpIfInventory("RodPowerLevel", 4, 2)
BROG O 0 A_GiveInventory("RodPowerLevel", 1)
BROG O 0 A_Refire
goto HyperRodAttackSP

HyperRodAttackSP:
BROG POPS 1
BROG S 0 A_PlaySoundEx("weapon/KnightShot", "Weapon")
BROG S 1 A_FireCustomMissile("BusterRodGHyperRodSP",0,1,8,0)
BROG S 0 SetPlayerProperty(0, 1, 4)
RodWaitingSP:
BROG S 0 //A_GiveInventory("BusterRodGProtection", 999)
BROG S 0 A_GiveInventory("BRGRod", 1)
BROG S 0 A_JumpIfInventory("BusterRodGWait", 55, "RodEndSP")
BROG S 0 A_JumpIfInventory("BusterRodGFree", 1, "RodEndSP")
BROG S 1 //A_Stop
BROG S 0 A_GiveInventory("BusterRodGWait", 1)
loop

RodEndSP:
SuperFailSP:
BROG S 0 //A_TakeInventory("BusterRodGProtection", 1)
BROG S 0 A_TakeInventory("BRGRod", 999)
BROG S 0 A_TakeInventory("BusterRodGWait", 999)
BROG S 0 A_TakeInventory("BusterRodGFree", 999)
BROG S 0 SetPlayerProperty(0, 0, 4)
BROG S 0 //A_TakeInventory("BusterRodGProtection", 999)
BROG S 6
BROG P 2
BROG O 2
Goto Ready+1


AltFire:
BROG O 1 A_JumpIfInventory("BossRageCharge4",2000,"BusterOversurge")
Goto RodSpin

BusterOversurge:
BROG O 0 A_GiveInventory("BusterRodBusterFlag",1)
BROG O 0 A_GiveInventory("BossRageCharge4",1)
BROG O 0 ACS_ExecuteAlways(400, 0, 229) // Take the bossragecharge to every hales
BROG O 35
BROG O 1 Offset(0,40)
BROG O 1 Offset(0,80)
BROG O 1 Offset(0,120)
BROG O 1 Offset(0,160)
TNT1 A 1
BRBS A 1 Offset(0,85)
BRBS A 1 Offset(0,60)
BRBS A 1 Offset(0,40)
BRBS A 1 Offset(0,20)
BRBS B 2
BusterOversurge2:
BRBS C 0 A_PlaySoundEx("weapon/mbuster","Weapon")
BRBS CC 0 A_FireCustomMissile("BusterBusterShot",random(-4,4),0,8,0,0,random(-4,4))
BRBS C 1 A_TakeInventory("BossRageCharge4",16)
BRBS B 1
BRBS B 1 A_JumpIfInventory("BossRageCharge4",1,"BusterOversurge2")
BRBS CCBA 17
BRBS A 1 Offset(0,20)
BRBS A 1 Offset(0,40)
BRBS A 1 Offset(0,60)
BRBS A 1 Offset(0,85)
TNT1 A 1 //A_TakeInventory("BossRageCharge4",4000)
BROG O 1 Offset(0,160)
BROG O 1 Offset(0,120)
BROG O 1 Offset(0,80)
BROG O 1 Offset(0,40)
BROG O 0 A_TakeInventory("BusterRodBusterFlag",1)
goto Ready+1

RodSpin:
BROG O 0 A_GiveInventory("BRGSpinFlag",1)
BROG O 1 offset(4,32)
BROG O 1 offset(2,32)A_TakeInventory("StopShield",1)
BROG O 1 offset(4,32)
BROG O 1 offset(2,32)A_TakeInventory("StopShield",1)
BROG F 0 A_GiveInventory("BRGShieldHitbox_P",1)
goto SpinToWin

SpinToWin:
BROG F 0 ACS_ExecuteAlways(191,0,APROP_Speed,35,100)
BROG F 0 A_JumpIfInventory("BRGSpinning",60,"MONKEYSONTHEBED")
BROG F 0 A_FireCustomMissile("BRGSpinBoom",0,0,-8,0)
BROG F 0 A_PlaySoundEx("weapon/BRGSpin","Weapon")
BROG F 1 offset(1,32)
BROG G 1 offset(1,32)
BROG G 1 A_GiveInventory("BRGSpinning",1)
BROG G 0 A_Refire("SpinToWin")
goto AltFireEnd
AltFireEnd:
BROG F 0 A_PlaySoundEx("weapon/topspin","Weapon")
BROG FG 2 offset(1,32)
BROG F 0 A_TakeInventory("BRGSpinFlag",99)
BROG FG 3 offset(1,32)
BROG O 2 offset(2,32)
BROG O 2 offset(4,32)
BROG O 2 offset(6,32)
BROG O 2 offset(2,32)
BROG O 2 offset(4,32)
BROG O 2 offset(6,32)
BROG O 2 offset(-6,32)
BROG O 2 offset(-4,32)
BROG O 2 offset(-2,32)
BROG O 1 A_WeaponReady(14)
BROG F 0 A_GiveInventory("StopShield",1)
Goto MONKEYSONTHEBED2
MONKEYSONTHEBED:
BROG FG 2 offset(1,32)
BROG F 0 A_TakeInventory("BRGSpinFlag",99)
BROG FG 3 offset(1,32)
BROG O 2 offset(2,32)
BROG O 2 offset(4,32)
BROG O 2 offset(6,32)
BROG O 2 offset(2,32)
BROG O 2 offset(4,32)
BROG O 2 offset(6,32)
BROG O 2 offset(-6,32)
BROG O 2 offset(-4,32)
BROG O 2 offset(-2,32)
BROG O 1 A_WeaponReady(14)
BROG F 0 A_GiveInventory("StopShield",1)
MONKEYSONTHEBED2:
BROG O 2 A_TakeInventory("BRGSpinning",1)
BROG O 0 A_JumpIfInventory("BRGSPINNING",1,"MONKEYSONTHEBED2")
BROG O 0 ACS_ExecuteAlways(191,0,APROP_Speed,100,100)
goto Ready+1
NoAmmo:
BROG O 1 ACS_Execute(979,0)
BROG O 0 A_Refire
goto Ready+1
}
}

actor BusterBusterShot : FastProjectile
{
species "GenesisUnit" +THRUSPECIES +MTHRUSPECIES
PROJECTILE
damagetype "BossInstagib"
Obituary "$OB_BUSTEROVERSURGE"
Speed 56
Damage (5)
radius 5
height 5
scale 2.5
States
{
Spawn:
TNT1 A 1
BASB A 1
wait
}
}


actor BusterRodGIllusionMedium
{
+NOINTERACTION
+DONTBLAST
+NOGRAVITY
-SOLID
scale 2.5
reactiontime 5
states
{
Spawn:
BROG L 0
TNT1 A 1 ACS_ExecuteAlways(991,0,519)
RunRun:
TNT1 A 0 A_CheckFloor("SheKeepsOnRunningRunningRunning")
BRGZ I 1 A_SetTranslucent(0.2)
BRGZ I 1 A_SetTranslucent(0.85)
BRGZ I 1 A_SetTranslucent(0.2)
BRGZ I 1 A_SetTranslucent(0.85)
BRGZ I 1 A_SetTranslucent(0.2)
BRGZ I 1 A_SetTranslucent(0.85)
BRGZ I 1 A_SetTranslucent(0.2)
BRGZ I 1 A_SetTranslucent(0.85)
BROG N 0 A_CountDown
loop
SheKeepsOnRunningRunningRunning:
BRGZ B 1 A_SetTranslucent(0.2)
BRGZ B 1 A_SetTranslucent(0.85)
BRGZ B 1 A_SetTranslucent(0.2)
BRGZ C 1 A_SetTranslucent(0.85)
BRGZ C 1 A_SetTranslucent(0.2)
BRGZ C 1 A_SetTranslucent(0.85)
BRGZ D 1 A_SetTranslucent(0.2)
BRGZ D 1 A_SetTranslucent(0.85)
BRGZ D 1 A_SetTranslucent(0.2)
BRGZ C 1 A_SetTranslucent(0.85)
BRGZ C 1 A_SetTranslucent(0.2)
BRGZ C 1 A_SetTranslucent(0.85)
TNT1 A 0 A_GiveInventory("CutterFlag", 1)
TNT1 A 0 A_JumpIfInventory("CutterFlag", 3, "Death")
loop
Death:
TNT1 A 0
stop
}
}

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

actor BRGSpinning : Inventory
{
inventory.amount 1
inventory.maxamount 60
}

actor BusterRodGRodHit : SaxtonFist
{
species "GenesisUnit" +THRUSPECIES +MTHRUSPECIES
Obituary "$OB_DUELROD"
+RIPPER
-NOINTERACTION
radius 10
height 25
damage (5) // (25) / 2 tics
speed 36
+DONTBLAST
damagetype "BossInstagib"
scale 3.25
states
{
Spawn:
BRGZ POOO 1
stop
}
}

actor BusterRodGMegaRod // The expanding rod is inspired by the code of Thunder Claw, Shadow Blade and
// Spring Man's ALT (from YD Classes)
{
species "GenesisUnit" +THRUSPECIES +MTHRUSPECIES
PROJECTILE
+SKYEXPLODE
+RIPPER
+FORCEXYBILLBOARD
damage (13)
speed 55
damagetype "BossInstagib"
Radius 14
Height 18
scale 3.8
states
{
Spawn:
BROG U 0
BRGZ POOPP 1  A_CustomMissile("BusterRodGStick", 0, 0, 0, 0) // 5 tics
Death:
SearchingForMama:
TNT1 A 0 A_PlaySound("BusterRodG/WildFrictionInterception")
TNT1 A 1 A_CustomMissile("BusterRodGRodReturn", 0, 0, 0, 0)
stop
}
}

actor BusterRodGMegaRodSP : BusterRodGMegaRod
{
speed 72
states
{
Spawn:
BROG U 0
BROG UV 1 A_CustomMissile("BusterRodGStickSP", 0, 0, 0, 0)
Death:
SearchingForMama:
BROG V 0 A_PlaySound("BusterRodG/WildFrictionInterception")
BROG V 0 A_CustomMissile("BusterRodGRodReturnSP", 0, 0, 0, 0)
stop
}
}

actor BusterRodGUltraRod : BusterRodGMegaRod
{
damage (16)
states
{
Spawn:
TNT1 A 0
BRGZ POOPPOOP 1 A_CustomMissile("BusterRodGStick", 0, 0, 0, 0) // 10 tics
goto SearchingForMama
}
}

actor BusterRodGUltraRodSP : BusterRodGMegaRodSP
{
damage (15)
states
{
Spawn:
BROG U 0
BROG UVUVU 1 A_CustomMissile("BusterRodGStickSP", 0, 0, 0, 0)
goto SearchingForMama
}
}

actor BusterRodGGigaRod : BusterRodGMegaRod
{
damage (17)
states
{
Spawn:
TNT1 A 0
BRGZ POOPPOOPPOO 1 A_CustomMissile("BusterRodGStick", 0, 0, 0, 0) // 18 tics
goto SearchingForMama
}
}

actor BusterRodGGigaRodSP : BusterRodGMegaRodSP
{
damage (17)
states
{
Spawn:
BROG U 0
BROG VUVUVUVUV 1 A_CustomMissile("BusterRodGStickSP", 0, 0, 0, 0)
goto SearchingForMama
}
}

actor BusterRodGHyperRod : BusterRodGMegaRod
{
Obituary "$OB_DUELROD"
damage (11)
states
{
Spawn:
TNT1 A 0
BRGZ POOPPOOPPOOPPO 1 A_CustomMissile("BusterRodGStick", 0, 0, 0, 0) // 24 tics
goto SearchingForMama
}
}

actor BusterRodGHyperRodSP : BusterRodGMegaRodSP
{
Obituary "$OB_DUELROD"
damage (11)
+THRUGHOST
states
{
Spawn:
BROG U 0
BROG UVUVUVUVUVUV 1 A_CustomMissile("BusterRodGStickSP", 0, 0, 0, 0)
goto SearchingForMama
}
}

actor BusterRodGRodReturn : BusterRodGMegaRod
{
+NOCLIP
+RIPPER
+THRUGHOST
states
{
Spawn:
TNT1 A 0
BRGZ O 1 A_FaceTarget
TNT1 A 0 A_SetAngle(angle-180)
BRGZ OO 1 A_JumpIfCloser(90, "ImARodAndImProudOfIt")
TNT1 A 0 A_CustomMissile("BusterRodGRodReturn2", 0, 0, 0, 0)
stop
ImARodAndImProudOfIt:
TNT1 A 2 A_GiveToTarget("BusterRodGFree", 1)
stop
}
}

actor BusterRodGRodReturn2 : BusterRodGRodReturn
{
+RIPPER
states
{
Spawn:
TNT1 A 0
BRGZ P 1 A_FaceTarget
TNT1 A 0 A_SetAngle(angle-180)
BRGZ PP 1 A_JumpIfCloser(60, "ImARodAndImProudOfIt")
TNT1 A 0 A_CustomMissile("BusterRodGRodReturn", 0, 0, 0, 0)
stop
}
}

actor BusterRodGRodReturnSP : BusterRodGRodReturn
{
+RIPPER
speed 72
states
{
Spawn:
BROG U 0
BROG XY 1 A_JumpIfCloser(96, "ImARodAndImProudOfIt")
BROG U 0 A_CustomMissile("BusterRodGRodReturnSP", 0, 0, 0, 0)
stop
}
}

actor BusterRodGProtection : RuneHalfDamage
{
inventory.maxamount 1
}


actor BusterRodGStick : BusterRodGMegaRod
{
+THRUGHOST
damage (0)
states
{
Spawn:
TNT1 A 0
TNT1 A 1 A_FaceTarget
TNT1 A 0 A_SpawnItemEx("BusterRodGStickFX")
TNT1 A 0 //A_SpawnItemEx("BusterRodGStickFX", momx*4,momy*4, momz, 0, 0, 0,0,SXF_ABSOLUTEMOMENTUM|SXF_NOCHECKPOSITION)
TNT1 A 0 A_SpawnItemEx("BusterRodGStickDamager")
TNT1 A 0 A_JumpIfCloser(90, "Death")
TNT1 A 1 A_FaceTarget
TNT1 A 0 A_SpawnItemEx("BusterRodGStickFX")
TNT1 A 0 //A_SpawnItemEx("BusterRodGStickFX", momx*4,momy*4, momz, 0, 0, 0,0,SXF_ABSOLUTEMOMENTUM|SXF_NOCHECKPOSITION)
TNT1 A 0 A_SpawnItemEx("BusterRodGStickDamager")
TNT1 A 0 A_JumpIfCloser(90, "Death")
TNT1 A 0 A_CustomMissile("BusterRodGStick", 0, 0, 0, 0)
stop
Death:
TNT1 A 0
stop
}
}

actor BusterRodGStickSP : BusterRodGStick
{
speed 72
states
{
Spawn:
TNT1 A 0
TNT1 A 1 A_FaceTarget
TNT1 A 0 A_SpawnItemEx("BusterRodGStickFX", 0, 0, 0)
TNT1 A 0 A_SpawnItemEx("BusterRodGStickDamager")
TNT1 A 0 A_JumpIfCloser(96, "Death")
TNT1 A 1 A_FaceTarget
TNT1 A 0 A_SpawnItemEx("BusterRodGStickFX")
TNT1 A 0 A_SpawnItemEx("BusterRodGStickDamager")
TNT1 A 0 A_JumpIfCloser(96, "Death")
TNT1 A 0 A_CustomMissile("BusterRodGStickSP", 0, 0, 0, 0)
stop
Death:
TNT1 A 0
stop
}
}

actor BusterRodGStickFX
{
+NOINTERACTION
+CLIENTSIDEONLY
+FORCEXYBILLBOARD
Damage(0)
Scale 3.8
states
{
Spawn:
BROG W 2
stop
}
}

actor BusterRodGStickDamager
{
species "GenesisUnit" +THRUSPECIES +MTHRUSPECIES
Obituary "$OB_DUELROD"
damagetype "BossInstagib"
PROJECTILE
+THRUGHOST
+FORCEXYBILLBOARD
+DONTBLAST
+LOOKALLAROUND
radius 20
height 12
Damage(2)
Scale 2.5
states
{
Spawn:
TNT1 A 2
stop
Death:
TNT1 A 0 A_Look
stop
See:
TNT1 A 30 A_GiveToTarget("BusterRodGDamageReduction",1)
stop
}
}

actor BusterRodGDamageReduction : PowerProtection
{
damagefactor "BusterRodG", 0.0
powerup.duration 20
}

actor BRGSpinFlag : OnceC{}

actor BusterRodGFree : OnceC{}

actor BusterRodGCharge : Inventory
{
inventory.amount 1
inventory.maxamount 1000
}

actor NoNeedToHyperAnymore : OnceC {}

actor RodPowerLevel : Inventory
{
inventory.amount 1
inventory.maxamount 4
}

actor WildFrictionDisallow : OnceC {}

actor StopBusterRodGIllusions : OnceC {}

actor BusterRodGTopSpinIllusion
{
PROJECTILE
+DONTBLAST
+NOINTERACTION
states
{
Spawn:
TNT1 A 0
TNT1 A 4 A_GiveToTarget("WildFrictionCloneItem100percents", 1)
TNT1 A 0 A_JumpIfInTargetInventory("StopBusterRodGIllusions", 1, "Death")
loop
Death:
TNT1 A 0
stop
}
}

actor BusterRodGSpeedster : PowerupGiver
{
Speed 1.0
powerup.duration -50
powerup.type "PowerFastBusterRodG"
+INVENTORY.AUTOACTIVATE
+INVENTORY.ALWAYSPICKUP
states
{
Pickup:
TNT1 AAAAAAA 250
stop
}
}

actor PowerFastBusterRodG : PowerSpeed
{
	Speed 1.0
}

actor BusterRodGScriptSpeed : CustomInventory
{
states
{
Pickup:
TNT1 A 0 ACS_NamedExecuteAlways("sh_speeds", 0, 3)
stop
}
}

actor BRGItemFire : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_SpawnItemEx("StopAirAssist")
stop
}
}


actor BusterRodGWait : Inventory
{
inventory.amount 1
inventory.maxamount 110
}

actor BusterRodBusterFlag : OnceC {}
actor BusterRodGButtonSuccess : OnceC {}
actor ScoriaSuccess : OnceC {}
actor StrobeFrostbiteSuccess : OnceC {}
actor NovaKickSuccess : OnceC {}


actor BRGShieldHitbox_P : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_SpawnItemEx("BRGShieldHitbox1",28,-16,8,0,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("BRGShieldHitbox2",28,-8,8,0,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("BRGShieldHitbox3",28,0,8,0,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("BRGShieldHitbox4",28,8,8,0,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("BRGShieldHitbox5",28,16,8,0,0,0,0,1)
stop
}
}

actor BRGShieldHitbox1 : BasicShieldHitbox
{
species "GenesisUnit" +THRUSPECIES +MTHRUSPECIES
Height 42
Radius 16
Meleerange 28
Accuracy -16
Mass 8
States
{
Pain:
TNT1 A 0 A_SpawnItemEx("BRGShieldDeathFX")
TNT1 A 0 A_PlaySound("item/protoreflect")
goto Spawn
}
}
actor BRGShieldHitbox2 : BRGShieldHitbox1
{
Accuracy -8
}
actor BRGShieldHitbox3 : BRGShieldHitbox1
{
Accuracy 0
}
actor BRGShieldHitbox4 : BRGShieldHitbox1
{
Accuracy 8
}
actor BRGShieldHitbox5 : BRGShieldHitbox1
{
Accuracy 16
}


actor BRGShieldDeathFX 
{
+CLIENTSIDEONLY
+NOINTERACTION
+NOGRAVITY
-SOLID
radius 2
height 2
scale 2.5
alpha 0.9
renderstyle add
Scale 2.0
states
{
Spawn:
PROC M 0 A_SetScale(scaleX + 0.1, 2.5) 
PROC M 1 A_FadeOut(0.05)
loop
}
}



actor BRGSpinBoom 
{
species "GenesisUnit" +THRUSPECIES +MTHRUSPECIES
+MISSILE
-SOLID
+DONTBLAST
+NOGRAVITY
+RIPPER
+SKYEXPLODE
+NOINTERACTION
+DONTSPLASH
+THRUGHOST
+THRUACTORS
+DONTREFLECT
Damage 0
radius 2
height 2
Obituary "$OB_RODSPIN"
damagetype "BossInstagib"
States
{
Spawn:
TNT1 A 0
TNT1 A 2 A_Explode(3,128,0,0,16)
stop
}
}