actor SpeakerSupportWep_NormalBar : NormalBar{args 225, 94}
actor SpeakerSupportWep : BaseMM8BDMWep
{
Weapon.AmmoUse 28
Weapon.AmmoGive 28
Weapon.SlotNumber 6
Inventory.Pickupmessage "$PU_SPEAKERSUPPORT"
Obituary "$OB_SPEAKERSUPPORT"
Tag "$TAG_SPEAKERSUPPORT"
weapon.ammotype "SpeakerSupportAmmo"
inventory.icon "SPSPICON"
States
{
SpawnLoop:
SPSP Z 1
loop
Ready:
SPSP F 0 ACS_NamedExecuteWithResult("core_weaponcolor",COLOR_SPEAKERSUPPORT)
SPSP F 1 A_WeaponReady
Goto Ready+1
ReadyC: Goto Ready+1
Deselect:
SPSP F 0
goto DeselectSwap
Select:
SPSP F 0
goto SelectSwap
Fire:
SPSP B 0 A_JumpIfNoAmmo("NoAmmo")
SPSP O 0 A_PlaySoundEx("item/refill","Voice")
SPSP O 0 A_TakeInventory("SpeakerSupportAmmo",28)
SPSP O 0 A_SpawnItemEx("SpeakerTeleport", 80, 0, 256, 0, 0, -24, 0, SXF_NOCHECKPOSITION, 0)
SPSP F 20 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
SPSP F 0 
goto Ready+1
NoAmmo:
SPSP F 1 ACS_NamedExecute("core_noammo",0)
goto Ready+1

}
}

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


actor SpeakerTeleport : BasicProjectile
{
translation "192:192=225:225", "198:198=95:95"
+RIPPER
+NOINTERACTION
+DONTBLAST
+SKYEXPLODE
damage (0)
Radius 8
Height 8
speed 0
states
{
Spawn:
TFOG A 0
TFOG A 9
TFOG A 0 A_ChangeFlag("NOINTERACTION", 0)
TFOG AAAAAAAAAA 1 A_CheckFloor("Next")
Goto Next
Next:
TFOG A 0
Goto Death
Death:
TNT1 A 0 A_SpawnItemEx("SpeakerSupportingMe",0,0,3,0,0,momz,0,SXF_NOCHECKPOSITION,0) 
stop
}
}

actor SpeakerSupportingMe : ProjSpawnFuncActor
{
-SOLID
+DONTBLAST
+NOCLIP
+SKYEXPLODE
+MISSILE
+DONTBLAST
-ISMONSTER
scale 2.5
Radius 24
Height 32
speed 6
meleerange 80
reactiontime 250
translation "192:192=211:211", "198:198=225:225"
states
{
Spawn:
TFOG A 0
TFOG A 0 A_JumpIfInventory("Once",1,"Death")
TFOG A 0 A_GiveInventory("Once",1)
TFOG A 0 A_ChangeFlag("MISSILE",0)
TFOG A 0 A_ChangeVelocity(0, 0, -32, CVF_REPLACE)
TFOG A 1 A_JumpIf(z-floorz<=0, "Search")
Goto Spawn+2
Search:
SPSP A 0 A_ChangeFlag("NOCLIP",0)
SPSP A 1
SPSP A 10 A_FaceTarget
SPSP B 3
SPSP C 2
SPSP D 10 A_SpawnItemEx("Speaker-LTank",0,0,32,4,0,12)
SPSP EA 3 
SPSP F 0 A_Die
Goto Death
Death:
TFOG A 0 ThrustThingZ(0, 34, 0, 1)
TFOG A 0 A_ChangeFlag("NOGRAVITY", 1)
TFOG A 1 A_JumpIf(z-ceilingz==0-32, "Bye")
Goto Death+2
Bye:
TFOG A 1
stop
}
}

actor Speaker-LTank : BaseMM8BDMUseItem
{
inventory.amount 1
inventory.maxamount 1
inventory.pickupmessage "$PU_LTANK"
Inventory.PickupSound "item/1up"
+INVENTORY.AUTOACTIVATE
-INVBAR
+COUNTITEM
scale 2.0
States
{
SpawnLoop:
EBAL K 0 
EBAL K 0 A_JumpIf(tid!=0, 2)
EBAL K 0 Thing_ChangeTID(0,999)
EBAL KE 6
Goto SpawnLoop+3
Pickup:
EBAL E 0 A_PlaySound("item/energyup")
EBAL E 0 A_PlaySoundEx("item/refill","Voice")
EBAL E 0 A_SpawnItemEx("ETankUse",  0, 0, 0, momx, momy, 20, 0, SXF_WEPFXCOLOR|SXF_ABSOLUTEMOMENTUM)
EBAL E 0 A_SpawnItemEx("ETankUse2", 0, 0, 0, momx, momy,  0, 0, SXF_WEPFXCOLOR|SXF_ABSOLUTEMOMENTUM)
EBAL E 0 A_GiveInventory("ETankHeal",1)
EBAL E 0 A_TakeInventory("Speaker-LTank",1)
stop
Death:
TNT1 A 0
stop
}
}
