actor ToxinBombWep_NormalBar : NormalBar{args 229,239}
actor ToxinBombWep : BaseMM8BDMWep
{
Weapon.AmmoUse 4
Weapon.AmmoGive 28
Weapon.SlotNumber 4
Inventory.Pickupmessage "$PU_TOXINBOMB"
Obituary "$OB_TOXINBOMB"
Tag "$TAG_TOXINBOMB"
weapon.ammotype "ToxinBombAmmo"
inventory.icon "WBOMICON"
States
{
SpawnLoop:
WBOM Z -1
loop
Ready:
WBOM B 0 ACS_NamedExecuteWithResult("core_weaponcolor",COLOR_TOXINBOMB)
WBOM B 1 A_WeaponReady
Goto Ready+1
ReadyC: Goto Ready+1
Deselect:
WBOM B 0 
goto DeselectSwap
Select:
WBOM B 0 
goto SelectSwap
Fire:
WBOM C 0 A_JumpIfNoAmmo("NoAmmo")
WBOM C 0 A_PlaySoundEx("weapons/mm5/napalmbombfire","Weapon")
WBOM C 1 A_FireCustomMissile("ToxinBombGasBomb",0,1,8,0)
WBO0 ABCDEF 3
WBOM B 5
Goto Ready+1
NoAmmo:
WBOM B 0 ACS_NamedExecuteAlways("core_noammo",0)
Goto Ready+1
}
}

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


actor ToxinBombGasBomb : BasicProjectile
{
Translation "41:41=239:239"
PROJECTILE
damagetype "ToxinBomb"
Obituary "$OB_TOXINBOMB"
-NOGRAVITY
+HEXENBOUNCE
-BOUNCEONFLOORS
Damage (CallACS("vile_cbm_damage",20))
Radius 16
Height 16
scale 2.5
speed 24
reactiontime 85 //85
States
{
Spawn:
WBOM A 0
WBOM A 0 ThrustThingZ(0, 12, 0, 1)
WBOM A 1 A_CountDown
Goto Spawn+2
Death:
BOMB A 0 A_Stop
BOMB A 0 A_PlaySoundEx("weapon/cfire", "Weapon")
BOMB A 0 A_Explode(CallACS("vile_cbm_damage",24), 140, 0,0,64)
TNT1 A 4 A_SpawnItemEx("ExplosionEffect3")
goto Gas
Gas:
TNT1 R 0 A_JumpIfInventory("CutterFlag", 45, "Death2")
TNT1 A 0 A_Explode(CallACS("vile_cbm_damage",4),96,0,0,96)
TNT1 R 0 A_SpawnItemEx("ToxinBombGas", 96, 0, 4, 0, 0, random(0, 1), 0,SXF_NOCHECKPOSITION)
TNT1 R 0 A_SpawnItemEx("ToxinBombGas", -96, 0, 4, 0, 0, random(0, 1), 0,SXF_NOCHECKPOSITION)
TNT1 R 0 A_SetAngle(angle-7.5)
TNT1 RR 0 A_SpawnItemEx("ToxinBombGas2", frandom(12,96), 0, 0, 0, 0, random(0, 2), random(0,359),SXF_NOCHECKPOSITION)
TNT1 A 2 A_GiveInventory("CutterFlag",1)
TNT1 R 0 A_JumpIfInventory("CutterFlag", 45, "Death2")
TNT1 A 0 A_Explode(CallACS("vile_cbm_damage",4),96,0,0,96)
TNT1 R 0 A_SetAngle(angle-7.5)
TNT1 A 2 A_GiveInventory("CutterFlag",1)
loop
Death2:
TNT1 A 0
stop
}
}


actor ToxinBombGas : BasicGraphicEffect
{
+BRIGHT
TRANSLATION "236:236=239:239"
renderstyle translucent
alpha 0.8
states
{

	SpawnFrame:
	SHAB R 0 ACS_NamedExecuteWithResult("core_alphaprojectile", CallACS("core_getptrtid", AAPTR_TARGET), APROJ_TEAM, 3276, 512) // 3276 = 0.05 * 65536
	SHAB RRRRRRSSSSSSTTTTTTSSSRRR 1 ThrustThingZ(0,random(1,2),0,1)
	stop
}
}


actor ToxinBombGas2 : ToxinBombGas
{
scale 1.25
states
{

	SpawnFrame:
	SHAB RRRRRRSSSSSSTTTTTTSSSRRR 1
	stop
}
}


actor ToxinBombProtect : PowerProtection {Damagefactor "ToxinBomb", 0.0 Powerup.Duration 4}