actor BusterRodG : BasisForHales
{
player.soundclass "BOSS701A"
player.forwardmove 1.06, 1.06
player.sidemove 1.05, 1.05
player.jumpz 14
player.morphweapon "BusterRodGBossWeapon"
States
{
Spawn:
BRGZ A 0
BRGZ B 1
BRGZ A 0 A_JumpIfInventory("BusterRodBusterFlag",1,"BusterMode")
BRGZ A 0 A_JumpIfInventory("BRGSpinFlag",1,"SpinRod")
BRGZ A 0 A_JumpIfInventory("BRGRod", 1, "EnvoyerBaton")
BRGZ A 1 A_JumpIf(z-floorz>0, "Jumping")
Goto Spawn+2

Pain.TimeStopper:
Pain.RNCZaWarudo:
TNT1 A 0 SetPlayerProperty(0,1,4) TNT1 A 0 A_GiveInventory("DioFlashTimeHUD", 1) TNT1 A 0 A_SpawnItem("ZaWarudoHaleFix")
BRGZ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_Stop
BRGZ A 1 SetPlayerProperty(0,0,4)
Goto Spawn

See:
BRGZ B 0 A_JumpIfInventory("BRGRod", 1, "EnvoyerBaton")
BRGZ B 1 A_JumpIf(z-floorz>0, "Jumping")//A_JumpIfInventory("BRGRod", 1, "SpinRod")
BRGZ B 0 A_JumpIfInventory("BRGRod", 1, "EnvoyerBaton")
BRGZ B 1 A_JumpIf(z-floorz>0, "Jumping")
BRGZ B 0 A_JumpIfInventory("BRGRod", 1, "EnvoyerBaton")
BRGZ B 1 A_JumpIf(z-floorz>0, "Jumping")
BRGZ B 0 A_JumpIfInventory("BRGRod", 1, "EnvoyerBaton")
BRGZ B 1 A_JumpIf(z-floorz>0, "Jumping")
BRGZ B 0 A_JumpIfInventory("BRGRod", 1, "EnvoyerBaton")
BRGZ B 1 A_JumpIf(z-floorz>0, "Jumping")
BRGZ B 0 A_JumpIfInventory("BRGRod", 1, "EnvoyerBaton")
BRGZ C 1 A_JumpIf(z-floorz>0, "Jumping")
BRGZ B 0 A_JumpIfInventory("BRGRod", 1, "EnvoyerBaton")
BRGZ C 1 A_JumpIf(z-floorz>0, "Jumping")
BRGZ B 0 A_JumpIfInventory("BRGRod", 1, "EnvoyerBaton")
BRGZ C 1 A_JumpIf(z-floorz>0, "Jumping")
BRGZ B 0 A_JumpIfInventory("BRGRod", 1, "EnvoyerBaton")
BRGZ C 1 A_JumpIf(z-floorz>0, "Jumping")
BRGZ B 0 A_JumpIfInventory("BRGRod", 1, "EnvoyerBaton")
BRGZ C 1 A_JumpIf(z-floorz>0, "Jumping")
BRGZ B 0 A_JumpIfInventory("BRGRod", 1, "EnvoyerBaton")
BRGZ D 1 A_JumpIf(z-floorz>0, "Jumping")
BRGZ B 0 A_JumpIfInventory("BRGRod", 1, "EnvoyerBaton")
BRGZ D 1 A_JumpIf(z-floorz>0, "Jumping")
BRGZ B 0 A_JumpIfInventory("BRGRod", 1, "EnvoyerBaton")
BRGZ D 1 A_JumpIf(z-floorz>0, "Jumping")
BRGZ B 0 A_JumpIfInventory("BRGRod", 1, "EnvoyerBaton")
BRGZ D 1 A_JumpIf(z-floorz>0, "Jumping")
BRGZ B 0 A_JumpIfInventory("BRGRod", 1, "EnvoyerBaton")
BRGZ D 1 A_JumpIf(z-floorz>0, "Jumping")
BRGZ B 0 A_JumpIfInventory("BRGRod", 1, "EnvoyerBaton")
BRGZ C 1 A_JumpIf(z-floorz>0, "Jumping")
BRGZ B 0 A_JumpIfInventory("BRGRod", 1, "EnvoyerBaton")
BRGZ C 1 A_JumpIf(z-floorz>0, "Jumping")
BRGZ B 0 A_JumpIfInventory("BRGRod", 1, "EnvoyerBaton")
BRGZ C 1 A_JumpIf(z-floorz>0, "Jumping")
BRGZ B 0 A_JumpIfInventory("BRGRod", 1, "EnvoyerBaton")
BRGZ C 1 A_JumpIf(z-floorz>0, "Jumping")
BRGZ B 0 A_JumpIfInventory("BRGRod", 1, "EnvoyerBaton")
BRGZ C 1 A_JumpIf(z-floorz>0, "Jumping")
Goto Spawn

Jumping:
BRGZ I 0 A_JumpIfInventory("BRGRod", 1, "EnvoyerBaton")
BRGZ I 1 A_JumpIf(z-floorz<=0, "Spawn")
loop

Missile:
BRGZ F 0 A_JumpIfInventory("BusterRodBusterFlag",1,"BusterMode")
BRGZ F 1 A_JumpIfInventory("BRGSpinFlag",1,"SpinRod")
BRGZ JJJJ 1 A_JumpIfInventory("BRGRod", 1, "EnvoyerBaton") 
BRGZ F 0 A_JumpIfInventory("BusterRodBusterFlag",1,"BusterMode")
BRGZ K 1 A_JumpIfInventory("BRGSpinFlag",1,"SpinRod")
BRGZ KKKKKKK 1 A_JumpIfInventory("BRGRod", 1, "EnvoyerBaton") 
goto Spawn
BusterMode:
BRGZ ZZZZZ 1
BRGZ Z 1 A_JumpIfInventory("BusterRodBusterFlag",1,"BusterMode")
BRGZ G 1
goto Spawn

EnvoyerBaton:
BRGZ J 1 A_JumpIfInventory("BRGSpinFlag",1,"SpinRod")
BRGZ J 0 A_JumpIf(z-floorz>0, "BatonAerien")
BRGZ J 2
EnvoyerBatonSP:
BRGZ K 1 A_JumpIfInventory("BRGSpinFlag",1,"SpinRod")
BRGZ K 2
BRGZ K 0 A_JumpIfInventory("BRGRod", 1, "EnvoyerBatonSP")
BRGZ K 2
goto Spawn

BatonAerien:
BRGZ L 2
BatonAerienSP:
BRGZ M 2
BRGZ M 0 A_JumpIfInventory("BRGRod", 1, "BatonAerienSP")
BRGZ M 2
goto Spawn

SpinRod:
BRGZ FG 2
BRGZ G 1 A_JumpIfInventory("BRGRod", 1, "SpinRod") 
goto Spawn

BossPain:
BRGZ H 0 A_JumpIfInventory("GenesisUnitFakeHealth", 1, "ShieldPain")
BRGZ H 0 //A_PlaySound("misc/devilpain")
BRGZ HHHHHHHHH 2 //A_SpawnItem("PainFX",-3,20)
BRGZ H 0 SetPlayerProperty(0,0,1)
Goto Spawn

ShieldPain:
"----" H 0 A_PlaySound("misc/splash")
"----" H 0 A_SpawnItem("PainFX",-3,20)
"----" H 0 SetPlayerProperty(0,0,1)
Goto Spawn

Death:
BRGZ H 0 SetPlayerProperty(0, 0, 4) 
BRGZ H 0 A_NoBlocking
BRGZ H 0 //SetPlayerProperty(0,2,5)
BRGZ H 0 A_Stop
BRGZ H 1 A_GiveToTarget("KilledMe",1)
BRGZ H 18
BRGZ H 0 A_GiveInventory("IsDead", 1)
BRGZ H 0 ACS_ExecuteAlways(400,0,437)
BRGZ H 0 SetPlayerProperty(0, 0, 4)
BRGZ H 0 A_PlayerScream
PLAY H 0 A_SpawnItemEx("FakeDeathFX", 0, 0, 32)
PLAY Z 1 A_CheckPlayerDone
wait
}
}

actor BRGPainKit : CustomInventory
{
states
{
Pickup:
BRGZ H 0 A_JumpIfHealthLower(1, "NoHeIsDead")
BRGZ H 0 A_JumpIfInventory("GenesisUnitFakeHealth", 1, "Shielder")
BRGZ H 0 A_PlaySound("misc/devilpain")
BRGZ H 0 A_SpawnItem("PainFX",-3,20)
stop
Shielder:
TNT1 A 0
stop
NoHeIsDead:
TNT1 A 0
stop
}
}

actor BusterRodGCorpse
{
+NOINTERACTION
+NOGRAVITY
+CLIENTSIDEONLY
scale 2.5
states
{
Spawn:
TNT1 A 0
TNT1 A 1 ACS_ExecuteAlways(991,0,519)
BROG A 19
BROG FAFA 9
BROG A 30
EscapeRope:
BROG FGFGFGFGFGFGFGFGFGFGFGFGFGFGFGFGFGFGFGFGFG 2 ThrustThingZ(0,9,0,1)
goto Death
Death:
TNT1 A 0
stop
}
}

actor WildFrictionItem : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
inventory.icon "SXISIA"
tag "-==Wild Friction==-"
+INVENTORY.UNDROPPABLE
+COUNTITEM
+INVBAR
states
{
Spawn:
TNT1 A 0
loop
Use:
TNT1 A 0
TNT1 A 0 A_JumpIfInventory("BRGSpinFlag",1,5)
TNT1 A 0 A_JumpIfInventory("WildFrictionDisallow", 1, 4)
TNT1 A 0 A_JumpIfInventory("WildFrictionFrictioning",1,"ReverseJump")
TNT1 A 0 A_JumpIfInventory("InBoat",1,2)
TNT1 A 0 A_JumpIfInventory("FrictionJumpCharge",125,"Jump")
TNT1 A 0
fail
Jump:
//TNT1 A 0 A_JumpIfInventory("BusterRodGPressureCounter", 1, 2) // allows to use in mid-air if Pressure is in use
//TNT1 A 0 A_JumpIf(z-floorz>=1, "FailState")
TNT1 A 0 A_PlaySoundEx("weapon/freezefloor", "Item")
TNT1 A 0 A_TakeInventory("FrictionJumpCharge",125)
TNT1 A 0 ThrustThingZ(0,90,0,0)
TNT1 A 0 A_SpawnItemEx("WildFrictionAssist")
TNT1 A 0 A_GiveInventory("WildFrictionFrictioning", 1)
TNT1 A 0 A_TakeInventory("JumpCancler",1)
TNT1 A 0
fail
ReverseJump:
TNT1 A 0// A_JumpIf(z-floorz<=200, "FailState") // nerf : BRG must be enough high to dash :/
TNT1 A 0 A_Stop
TNT1 A 0 A_GiveInventory("WildFrictionPhase2", 1)
TNT1 A 0 A_GiveInventory("BlurryRage", 1)
TNT1 A 0 A_PlaySoundEx("BusterRodG/WildFrictionInterception", "Auto")
TNT1 A 0 A_SpawnItemEx("ZaWarudoBang", -5, 0, 0, 0, 0, 0)
TNT1 A 0 A_TakeInventory("WildFrictionFrictioning",1)
TNT1 A 0 ThrustThingZ(0,20,1,0)
TNT1 A 0 A_Recoil(-36)
TNT1 A 0
fail
FailState:
TNT1 A 0
fail
}
}

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

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

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

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

actor WildFrictionAssist
{
PROJECTILE
+NOINTERACTION
+DONTBLAST
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_GiveToTarget("WildFrictionFrictioningChecker", 1)
TNT1 A 0 A_JumpIfInTargetInventory("WildFrictionPhase2", 1, "Phase2")
TNT1 A 1 A_JumpIfInTargetInventory("WildFrictionPhase1End", 1, "Death")
loop
Death:
TNT1 A 0 A_TakeFromTarget("WildFrictionPhase1End", 999)
stop
Phase2:
TNT1 A 0 A_TakeFromTarget("WildFrictionPhase2", 999)
TNT1 A 0 A_SpawnItemEx("WildFrictionAssist2")
stop
}
}

actor WildFrictionAssist2 : WildFrictionAssist
{
states
{
Spawn:
TNT1 A 0
GivingClonesOfMe:
TNT1 A 4 A_GiveToTarget("WildFrictionCloneItem", 1)
TNT1 A 0 A_JumpIfInTargetInventory("WildFrictionFinished", 1, "Death")
loop
Death:
TNT1 AAA 4 A_GiveToTarget("WildFrictionCloneItem100percents", 1)
TNT1 A 0 A_TakeFromTarget("WildFrictionFinished", 999)
TNT1 A 0 A_TakeFromTarget("WildFrictionFrictioning", 999)
stop
}
}


actor WildFrictionCloneItem : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_JumpIf(z-floorz<=0, "BackToIRL")
TNT1 A 0// A_SetTranslucent(0.50, 0)
TNT1 A 0 A_SpawnItemEx("BusterRodGIllusionMedium", 0, 0, 0, 0, 0, 0)
stop
BackToIRL:
TNT1 A 0 A_GiveInventory("FrictionTotalOpaque", 1)
TNT1 A 0 A_GiveInventory("WildFrictionFinished", 1)
stop
}
}

actor WildFrictionCloneItem100percents : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_SpawnItemEx("BusterRodGIllusionMedium", 0, 0, 0, 0, 0, 0)
stop
}
}

actor WildFrictionFrictioningChecker : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_JumpIf(z-floorz<=0, "BackToIRL")
stop
BackToIRL:
TNT1 A 0 A_TakeInventory("WildFrictionFrictioning", 999)
TNT1 A 0 A_GiveInventory("WildFrictionPhase1End", 999)
stop
}
}

actor FrictionTotalOpaque : CustomInventory
{
states
{
Pickup:
TNT1 A 0
TNT1 A 0 A_TakeInventory("PowerShadow", 999)
TNT1 A 2 A_SetTranslucent(1.0, 0)
stop
}
}

actor FrictionJumpCharge : Ammo
{
+INVENTORY.IGNORESKILL
inventory.amount 1
inventory.maxamount 125
}