actor BoobeamBarrierWep_NormalBar : NormalBar { args 39, 198 }

actor BoobeamBarrierWep : BaseMM8BDMWep
{
Weapon.AmmoUse 7
Weapon.AmmoGive 28
Weapon.SlotNumber 7
Inventory.Pickupmessage "$PU_BOOBEAMBARRIER"
Obituary "$OB_BOOBEAMBARRIER"
Tag "$TAG_BOOBEAMBARRIER"
weapon.ammotype "BoobeamBarrierAmmo"
inventory.icon "XTR0WI_F"
States
{
SpawnLoop:
XWI0 F -1
loop

Deselect:
XH0F A 0
goto DeselectSwap
Select:
XH0F A 0 A_TakeInventory("BoobeamBarrierFlag")
goto SelectSwap

Ready:
XH0F A 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_BOOBEAMBARRIER)
XH0F A 1 A_WeaponReady
wait

Fire:
XH0F A 0 A_JumpIfNoAmmo("NoAmmo")
XH0F A 0 A_TakeInventory("BoobeamBarrierAmmo",7,1)
XH0F BCDEF 2
XH0F A 0 A_SpawnItemEx("BoobeamBarrier",50,0,32,0,0,0,35,32,0)
XH0F A 0 A_SpawnItemEx("BoobeamBarrier",50,0,32,0,0,0,125,32,0)
XH0F A 0 A_SpawnItemEx("BoobeamBarrier",50,0,32,0,0,0,215,32,0)
XH0F A 0 A_SpawnItemEx("BoobeamBarrier",50,0,32,0,0,0,305,32,0)
Hold:
TNT1 A 1 A_PlaySoundEx("wep/BB_BarrierActive","Weapon")
TNT1 A 0 A_Refire("Hold1")
goto Split
Hold1:
TNT1 A 1 A_JumpIfInventory("BoobeamBarrierFlag",4,"Split")
TNT1 A 0 A_Refire("Hold2")
Hold2:
TNT1 A 1
TNT1 A 0 A_Refire("Hold3")
goto Split
Hold3:
TNT1 A 0 A_JumpIfInventory("IsBot",1,"BotHold3")
TNT1 A 1
TNT1 A 0 A_Refire("Hold")
goto Split
BotHold3:
TNT1 A 0 A_Jump(24,"Split")
goto Hold3+1

Split:
TNT1 A 0 A_PlaySoundEx("wep/BB_BarrierSplit","Weapon")
TNT1 A 0 A_GiveInventory("PowerBoobeamBarrier",1)
TNT1 A 1
TNT1 AAA 4 A_TakeInventory("BoobeamBarrierFlag",9)
TNT1 A 2
XH0F A 2 OffSet(0,64)A_ClearRefire
XH0F A 2 OffSet(0,48)A_ClearRefire
Goto Ready+1
Altfire:
XH0F A 0 A_JumpIfNoAmmo("NoAmmo")
XH0F A 0 A_TakeInventory("BoobeamBarrierAmmo",7)
XH0F BCDEF 2
XH0F A 0 A_SpawnItemEx("BoobeamBarrier",50,0,32,0,0,0,35,32,0)
XH0F A 0 A_SpawnItemEx("BoobeamBarrier",50,0,32,0,0,0,125,32,0)
XH0F A 0 A_SpawnItemEx("BoobeamBarrier",50,0,32,0,0,0,215,32,0)
XH0F A 0 A_SpawnItemEx("BoobeamBarrier",50,0,32,0,0,0,305,32,0)
TNT1 A 1 A_PlaySoundEx("wep/BB_BarrierActive","Body")
goto Split
NoAmmo:
XH0F A 1 ACS_NamedExecuteAlways("core_noammo",0)
Goto Ready+1
}
}

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

actor PowerBoobeamBarrier : Powerup
{
Powerup.Duration 8
}

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


actor BoobeamBarrier : ProjSpawnFuncActor
{
damagetype "BoobeamBarrier"
Obituary "$OB_BOOBEAMBARRIERX"
+MISSILE
//+SHOOTABLE
+NOBLOOD
+NOGRAVITY
+NOCLIP
+DONTSPLASH
+DONTBLAST
+DONTREFLECT
+DONTDRAIN
//+NOTARGETSWITCH
+QUICKTORETALIATE
+FORCEXYBILLBOARD
//+EXPLODEONDEATH
//+DONTRIP
+THRUSPECIES
Species "DumbBoobeamBarrier"
+INVULNERABLE
+NOPAIN

damagefactor "BoobeamBarrier",0.0

health 20000
painchance 256
damage (0)
radius 16
height 16
scale 2.5
States
{
Spawn:
XH0F W 0
XH0F W 0 A_RearrangePointers(0,0,2)
XH0F W 0 //A_ClearTarget
XH0F W 0 A_ChangeFlag("INVULNERABLE",0)
XH0F W 0 A_ChangeFlag("NOPAIN",0)
XH0F W 0 A_ChangeFlag("SHOOTABLE",1)
XH0F W 0 //A_ChangeFlag("NOTARGETSWITCH",0)
goto Spawn2
Spawn2:
XH0F W 0 A_JumpIf(CallACS("core_targetexists")==0,"SuperDeath")
XH0F W 0 A_JumpIfInventory("PowerBoobeamBarrier",1,"Split",8)
XH0F W 1 A_Warp(8,50,0,32,10,28)//WARPF_USECALLERANGLE|WARPF_NOCHECKPOSITION|WARPF_INTERPOLATE
XH0F W 0 A_JumpIf(CallACS("core_targetexists")==0,"SuperDeath")
XH0F W 0 A_JumpIfInventory("PowerBoobeamBarrier",1,"Split",8)
XH0F W 1 A_Warp(8,50,0,32,10,28)
XH0F X 0 A_JumpIf(CallACS("core_targetexists")==0,"SuperDeath")
XH0F X 0 A_JumpIfInventory("PowerBoobeamBarrier",1,"Split",8)
XH0F X 1 A_Warp(8,50,0,32,10,28)
XH0F X 0 A_JumpIf(CallACS("core_targetexists")==0,"SuperDeath")
XH0F X 0 A_JumpIfInventory("PowerBoobeamBarrier",1,"Split",8)
XH0F X 1 A_Warp(8,50,0,32,10,28)
loop
Split:
XH0F X 0 A_RearrangePointers(8,0,0)
XH0F X 0 A_FaceTarget
XH0F X 0 A_SpawnItemEX("BoobeamBarrierTrapSpawner",0,0,0,5,0,3,180)
XH0F X 0 A_JumpIfInTargetInventory("PlayerPropertySpread",1,"Split_S")
stop
Split_S:
XH0F X 0 A_SpawnItemEX("BoobeamBarrierTrapSpawner",0,0,0,5,0,3,195)
XH0F X 0 A_SpawnItemEX("BoobeamBarrierTrapSpawner",0,0,0,5,0,3,165)
stop

Pain:
XH0F Y 0 A_ChangeFlag("INVULNERABLE",1)
XH0F Y 0 A_ChangeFlag("NOPAIN",1)
XH0F Y 0 A_PlaySoundEx("weapon/BoobeamFlash","Weapon")
XH0F YY 1 A_Warp(8,50,0,32,10,28)
XH0F Y 0 A_RearrangePointers(8,0,2)
XH0F Y 0 A_PlaySoundEx("weapon/BoobeamFlash","Weapon")
XH0F WW 1 A_Warp(2,50,0,32,10,28)
XH0F Y 0 A_PlaySoundEx("weapon/BoobeamPew","Body")
XH0F Y 0 A_FaceTracer(0,0)
XH0F Y 0 A_CustomMissile("BoobeamBarrierShot",8,0,0,2,pitch)
XH0F Y 0 A_JumpIfInTargetInventory("PlayerPropertySpread",1,"Pain_S")
goto PainEnd
Pain_S:
XH0F Y 0 A_CustomMissile("BoobeamBarrierShot",8,0,15,2,pitch)
XH0F Y 0 A_CustomMissile("BoobeamBarrierShot",8,0,-15,2,pitch)
goto PainEnd
PainEnd:
XH0F Y 0 A_GiveToTarget("BoobeamBarrierFlag",1)
XH0F ZZZZ 1 A_Warp(2,50,0,32,10,28)
stop
Death:
TNT1 A 0 A_Explode(90,24,0,0,24)
SuperDeath:
MMFX BCDE 2
stop
}
}


actor BoobeamBarrierShot : ProjSpawnFuncActor
{
PROJECTILE
damagetype "BoobeamBarrier"
Obituary "$OB_BOOBEAMBARRIER"
+FORCEXYBILLBOARD
+BRIGHT
+THRUSPECIES
Species "DumbBoobeamBarrier"
Damage (170)
radius 12
height 12
Speed 52
scale 2.5
States
{
Spawn:
XH0F \ 0
XH0F \ 1
wait
XDeath:
XH0F \ 0
stop
Death:
XH0F \ 0
stop
}
}

const int COPY_BBTRAPSPEED = 52;

actor BoobeamBarrierShot2 : BoobeamBarrierShot
{
Damage (120)
Speed 52
States
{
Death:
XH0F \ 0 A_JumpIf(z-floorz==0,"Floor")
XH0F \ 0
stop
Floor:
XH0F \ 0 A_SpawnItemEx("BoobeamBarrierShot3",0,0,1,COPY_BBTRAPSPEED-2,0,0,0,1)
stop
}
}
actor BoobeamBarrierShot3 : BoobeamBarrierShot2
{
Damage (110)
States
{
Death:
goto XDeath
}
}

actor BoobeamBarrierTrapSpawner : ProjSpawnFuncActor
{
PROJECTILE
damagetype "BoobeamBarrier"
Obituary "$OB_BOOBEAMBARRIERX"
+SKYEXPLODE
+EXPLODEONWATER
+DONTSPLASH
+DONTREFLECT
+THRUSPECIES
Species "DumbBoobeamBarrier"
Damage(220)
Height 10
Radius 10
speed 25
Scale 2.5
States
{
Spawn:
XH0F W 0
XH0F WW 2 A_JumpIf(CallACS("core_targetexists")==0,"XDeath")
XH0F W 0 A_ChangeFlag("NOGRAVITY",0)
XH0F W 2 A_JumpIf(CallACS("core_targetexists")==0,"XDeath")
wait
Death:
TNT1 A 0 A_SetGravity(0.0)
XH0F ZZZZ 1 A_JumpIf(CallACS("core_targetexists")==0,"XDeath")
TNT1 A 0 A_PlaySound("weapon/crashland")
TNT1 A 0 A_JumpIf(z-floorz<5,"Floor")
TNT1 A 0 A_JumpIf(z-ceilingz==0-10,"Ceiling")
TNT1 A 0 A_SpawnItemEx("BoobeamBarrierTrap",0,0,0,0,0,0,0,1)
XDeath:
MMFX BCDE 2
TNT1 A 2
stop
Floor:
TNT1 A 0 A_SpawnItemEx("BoobeamBarrierTrapF",0,0,0,0,0,0,0,1)
goto XDeath
Ceiling:
TNT1 A 0 A_SpawnItemEx("BoobeamBarrierTrapC",0,0,0,0,0,0,0,1)
goto XDeath
}
}

actor BoobeamBarrierTrap : ProjSpawnFuncActor
{
PROJECTILE
damagetype "BoobeamBarrier"
Obituary "$OB_BOOBEAMBARRIER"
+NOCLIP
+DONTBLAST
+DONTREFLECT
+SEEKERMISSILE
+LOOKALLAROUND
reactiontime 350
Damage (0)
Radius 9
Height 9
Speed 0
scale 2.5
States
{
Spawn:
XH0F GG 3
XH0F A 0 A_SetArg(0,1)
XH0F LGLGLGLG 3 A_PlaySoundEx("weapon/BoobeamBeep","Body")
Goto Waiting
Waiting:
XH0F H 0 A_RearrangePointers(0,0,1)
XH0F HHHIIIJJJKKK 1 A_CountDown
XH0F H 0 A_SeekerMissile(0,0,3,256,4)
XH0F H 0 A_JumpIfTargetInLOS("FireTime",0,1,606)
XH0F H 0 A_JumpIf(CallACS("core_targetexists")==0,"Death")
loop

Delay1:
XH0F L 1 A_SpawnItemEx("BoobeamBarrierTrapX1",0,0,0,0,0,0,0,1025)
goto FireTime+2
Delay2:
XH0F L 2 A_SpawnItemEx("BoobeamBarrierTrapX2",0,0,0,0,0,0,0,1025)
goto FireTime+2
Delay3:
XH0F L 3 A_SpawnItemEx("BoobeamBarrierTrapX3",0,0,0,0,0,0,0,1025)
goto FireTime+2
Delay4:
XH0F L 0 A_SpawnItemEx("BoobeamBarrierTrapX4",0,0,0,0,0,0,0,1025)
XH0F LG 2
goto FireTime+2

FireTime:
XH0F L 0 A_Jump(256,1,"Delay1","Delay2","Delay3","Delay4")
XH0F L 0 A_SpawnItemEx("BoobeamBarrierTrapX",0,0,0,0,0,0,0,1025)
XH0F LG 2
XH0F L 1
XH0F L 0
XH0F L 1
XH0F LLLLLLLL 0 A_CountDown
XH0F L 0 A_JumpIfInTargetInventory("PlayerPropertyRage",1,7)
XH0F LLGGGGGG 1 A_CountDown
XH0F L 0 A_CountDownArg(0)
Goto Waiting
Death:
MMFX BCDE 2
stop
}
}

actor BoobeamBarrierTrapX : BasicExplosion
{
damagetype "BoobeamBarrier"
Obituary "$OB_BOOBEAMBARRIER"
States
{
Spawn:
TNT1 A 0
TNT1 A 0
goto Spawn2
Spawn2:
TNT1 AA 2 A_PlaySoundEx("weapon/BoobeamFlash","Weapon")
TNT1 A 1 A_SeekerMissile(4,10,2)
TNT1 A 0 A_FaceTracer(0,0)
TNT1 A 0 A_PlaySoundEx("weapon/BoobeamPew","Body")
TNT1 A 5 A_SpawnItemEx("BoobeamBarrierShot2",0,0,0,cos(pitch)*COPY_BBTRAPSPEED,0,sin(pitch)*COPY_BBTRAPSPEED,random(-2,2),1,0)
stop

}
}

actor BoobeamBarrierTrapX1 : BoobeamBarrierTrapX
{
States
{
Spawn:
TNT1 A 0
TNT1 A 1
goto Spawn2
}
}
actor BoobeamBarrierTrapX2 : BoobeamBarrierTrapX
{
States
{
Spawn:
TNT1 A 0
TNT1 A 2 A_PlaySoundEx("weapon/BoobeamFlash","Weapon")
goto Spawn2
}
}
actor BoobeamBarrierTrapX3 : BoobeamBarrierTrapX
{
States
{
Spawn:
TNT1 A 0
TNT1 A 1
TNT1 A 2 A_PlaySoundEx("weapon/BoobeamFlash","Weapon")
goto Spawn2
}
}
actor BoobeamBarrierTrapX4 : BoobeamBarrierTrapX
{
States
{
Spawn:
TNT1 A 0
TNT1 AA 2 A_PlaySoundEx("weapon/BoobeamFlash","Weapon")
goto Spawn2
}
}
actor BoobeamBarrierTrapF : BoobeamBarrierTrap
{
States
{
Spawn:
XH0F MM 3
XH0F M 0 A_SetArg(0,1)
XH0F QMQMQMQM 3 A_PlaySoundEx("weapon/BoobeamBeep","Body")
Goto Waiting
Waiting:
XH0F N 0 A_RearrangePointers(0,0,1)
XH0F NNNOOOPPPMMM 1 A_CountDown
XH0F N 0 A_SeekerMissile(0,0,3,256,4)
XH0F N 0 A_JumpIfTargetInLOS("FireTime",0,1,606)
XH0F N 0 A_JumpIf(CallACS("core_targetexists")==0,"Death")
loop
Delay1:
XH0F Q 1
goto FireTime+2
Delay2:
XH0F Q 2 A_PlaySoundEx("weapon/BoobeamFlash","Weapon")
goto FireTime+2
Delay3:
XH0F Q 1
XH0F Q 2 A_PlaySoundEx("weapon/BoobeamFlash","Weapon")
goto FireTime+2
Delay4:
XH0F QM 2 A_PlaySoundEx("weapon/BoobeamFlash","Weapon")
goto FireTime+2
FireTime:
XH0F Q 0
XH0F Q 0 A_Jump(256,1,"Delay1","Delay2","Delay3","Delay4")
XH0F QM 2 A_PlaySoundEx("weapon/BoobeamFlash","Weapon")
XH0F Q 1 A_SeekerMissile(4,10,SMF_PRECISE)
XH0F Q 0 A_FaceTracer(0,0)
XH0F Q 0 A_PlaySoundEx("weapon/BoobeamPew","Body")
XH0F Q 1 A_SpawnItemEx("BoobeamBarrierShot2",0,0,10,cos(pitch)*COPY_BBTRAPSPEED,0,sin(pitch)*COPY_BBTRAPSPEED,random(-2,2),1,0)
XH0F QQQQQQQQ 0 A_CountDown
XH0F Q 0 A_JumpIfInTargetInventory("PlayerPropertyRage",1,7)
XH0F QQMMMMMM 1 A_CountDown
XH0F M 0 A_CountDownArg(0)
goto Waiting
}
}

actor BoobeamBarrierTrapC : BoobeamBarrierTrap
{
States
{
Spawn:
XH0F RR 3
XH0F R 0 A_SetArg(0,2)
XH0F VRVRVRVR 3 A_PlaySoundEx("weapon/BoobeamBeep","Body")
Goto Waiting
Waiting:
XH0F S 0 A_RearrangePointers(0,0,1)
XH0F SSSTTTUUURRR 1 A_CountDown
XH0F S 0 A_SeekerMissile(0,0,3,256,4)
XH0F S 0 A_JumpIfTargetInLOS("FireTime",0,1,606)
XH0F S 0 A_JumpIf(CallACS("core_targetexists")==0,"Death")
loop
Delay1:
XH0F V 1
goto FireTime+2
Delay2:
XH0F V 2 A_PlaySoundEx("weapon/BoobeamFlash","Weapon")
goto FireTime+2
Delay3:
XH0F V 1
XH0F V 2 A_PlaySoundEx("weapon/BoobeamFlash","Weapon")
goto FireTime+2
Delay4:
XH0F VR 2 A_PlaySoundEx("weapon/BoobeamFlash","Weapon")
goto FireTime+2
FireTime:
XH0F V 0
XH0F V 0 A_Jump(256,1,"Delay1","Delay2","Delay3","Delay4")
XH0F VR 2 A_PlaySoundEx("weapon/BoobeamFlash","Weapon")
XH0F V 1 A_SeekerMissile(4,10,2)
XH0F V 0 A_FaceTracer(0,0)
XH0F V 0 A_PlaySoundEx("weapon/BoobeamPew","Body")
XH0F V 0 A_SpawnItemEx("BoobeamBarrierShot2",0,0,-8,cos(pitch)*COPY_BBTRAPSPEED,0,sin(pitch)*COPY_BBTRAPSPEED,random(-2,2),1,0)
XH0F VVVVVVVV 0 A_CountDown
XH0F V 0 A_JumpIfInTargetInventory("PlayerPropertyRage",1,7)
XH0F VVRRRRRR 1 A_CountDown
XH0F R 0 A_CountDownArg(0)
goto Waiting
}
}


