actor BusterRodPoleWep_NormalBar : NormalBar { args 102, 221 }

actor BusterRodPoleWep : BaseMM8BDMWep
{
Weapon.AmmoUse 2
Weapon.AmmoGive 28
Weapon.SlotNumber 3
Inventory.Pickupmessage "$PU_BUSTERRODPOLE"
Obituary "$OB_BUSTERRODPOLE"
Tag "$TAG_BUSTERRODPOLE"
weapon.ammotype "BusterRodPoleAmmo"
inventory.icon "XTR0WI_S"
States
{
SpawnLoop:
XWI0 S -1
loop

Deselect:
XH0S A 0
goto DeselectSwap
Select:
XH0S A 0
goto SelectSwap

Ready:
XH0S A 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_BUSTERRODPOLE)
XH0S A 1 A_WeaponReady
wait

Fire:
XH0S A 0 A_JumpIfNoAmmo("NoAmmo")
XH0S A 0 A_PlaySoundEx("weapon/BRGStaff","Weapon")
XH0S B 4 A_FireCustomMissile("BusterRodPoleWarper",0,1,8,0)
XH0S C 8
XH0S B 4
XH0S A 14
Goto Ready+1

NoAmmo:
XH0S A 1 ACS_NamedExecuteAlways("core_noammo",0)
Goto Ready+1
}
}

actor BusterRodPoleAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 28
+INVENTORY.IGNORESKILL
}

actor BusterRodPoleWarper : BasicExplosion
{
+NOTIMEFREEZE
RenderStyle None
ReactionTime 1
Speed 0
Args 0,1,8
States
{
Spawn:
TNT1 A 0
TNT1 A 0 ACS_NamedExecuteWithResult("cbm_CopyPointerAnglePitch",2,0)
TNT1 A 0
Forward:
TNT1 A 0 A_SetArg(0,Args[0]+1)
TNT1 A 0 A_Warp(2,cos(pitch)*(45.0*Args[0]),8.0,32.0-sin(pitch)*(45.0*Args[0]),angle,WARPF_ABSOLUTEANGLE+WARPF_NOCHECKPOSITION)//2+8
TNT1 A 1 A_SpawnItemEx("BusterRodPoleWhack",0,0,0,0,0,0,0,SXF_TRANSFERPITCH+SXF_TRANSFERSPECIAL)//512+32768
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")
TNT1 A 0 A_JumpIf(Args[0]>=Args[2],2)
loop
Back:
TNT1 A 0 A_SetArg(0,Args[0]-1)
TNT1 A 0 A_Warp(2,cos(pitch)*(45.0*Args[0]),8.0,32.0-sin(pitch)*(45.0*Args[0]),angle,2+8)
TNT1 A 1 A_SpawnItemEx("BusterRodPoleWhack",0,0,0,0,0,0,0,512+32768)
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")
TNT1 A 0 A_JumpIf(Args[0]<=1,1)
loop
TNT1 A 0 A_CountDown
goto Forward+1
}
}

actor BusterRodPoleFX0 : BasicClientSide
{
+NOTIMEFREEZE
RenderStyle None
Args 8
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SetPitch(Args[1]/100000.0)
TNT1 A 0 A_SetArg(0,Args[0]*4-3)
TNT1 A 0 A_JumpIf(Args[0]<0,"Death")
TNT1 A 0 A_CountDownArg(0)
SpawnL:
TNT1 A 0 A_CountDownArg(0)
TNT1 A 0 A_SpawnItemEx("BusterRodPoleFX1",-cos(pitch)*(11.25*Args[0]),0,sin(pitch)*(11.25*Args[0]),0,0,0,0,1)
loop
Death:
TNT1 A 0
stop
}
}

actor BusterRodPoleFX1 : BasicGraphicEffect
{
+NOTIMEFREEZE
States
{
SpawnFrame:
XH0S N 1
stop
}
}
actor BusterRodPoleFX2 : BusterRodPoleFX1
{
States
{
SpawnFrame:
XH0S O 1
stop
}
}
actor BusterRodPoleFX3 : BusterRodPoleFX1
{
States
{
SpawnFrame:
XH0S P 1
stop
}
}
actor BusterRodPoleFX4 : BusterRodPoleFX1
{
Radius 6
States
{
SpawnFrame:
XH0S N 0 A_Jump(256,1,2)
XH0S O 1
stop
XH0S P 1
stop
}
}

actor BusterRodPoleWhack : BasicExplosion
{
Damagetype "BusterRodPole"
Obituary "$OB_BUSTERRODPOLE"
States
{
Spawn:
TNT1 A 0
TNT1 A 0 ACS_NamedExecuteWithResult("cbm_Re_SetThingSpecial",Args[0], pitch*100000.0)
TNT1 A 0 A_Explode(110,40,0,0,40)
TNT1 A 0 A_SpawnItemEx("BusterRodPoleFX0",-cos(pitch)*11.25,0,sin(pitch)*11.25,0,0,0,0,1+32768)
TNT1 A 4 A_SpawnItemEx("BusterRodPoleFX4",0,0,0,0,0,0,0,1)
stop
}
}

