actor PlantBarrierWep : BaseMM8BDMWep 10069
{
//$Category MM8BDM-Weapons
//$Title Plant Barrier
//$Sprite WEA2T0
Weapon.AmmoUse 2
Weapon.AmmoGive 28
Weapon.SlotNumber 7
Inventory.Pickupmessage "$PU_PLANTBARRIER"
Obituary "$OB_PLANTBARRIER"
Tag "$TAG_PLANTBARRIER"
weapon.ammotype "PlantBarrierAmmo"
inventory.icon "PLANTSI"
States
{
SpawnLoop:
WEA2 T -1
loop
Ready:
PLAA A 0 ACS_ExecuteAlways(998,0,39)
PLAA A 0 A_ClearRefire
PLAA A 1 A_WeaponReady
Goto Ready+2
Deselect:
PLAA A 0 A_TakeInventory("PlantWeakener", 1)
PLAA A 0 A_JumpIfInventory("ShieldCheck",1,"KillShieldCheck")
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
PLAA A 1 A_Lower
Goto Deselect+1
KillShieldCheck:
PLAA A 1 A_TakeInventory("ShieldCheck",1)
Goto Deselect+2
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
PLAA A 1 A_Raise
Loop
Fire:
PLAA A 0 A_JumpIfInventory("ShieldCheck",1,"ShieldThrow")
PLAA A 0 A_JumpIfNoAmmo("NoAmmo")
PLAA A 0 A_PlaySoundEx("weapon/mbuster","Weapon")
PLAA A 1 A_GiveInventory("ShieldCheck",1)
goto ShieldActive
ShieldActive:
PLAA B 0 A_SpawnItemEx("PlantBarrierWarper")
PLAA BCDEFGH 2
PLAA A 0 A_GiveInventory("PlantWeakener",1)
Goto ShieldLoop
ShieldLoop:
PLAA AA 1 A_WeaponReady
PLAA A 0 A_GiveInventory("PlantBarrierHealer", 1)
PLAA A 0 A_JumpIfNoAmmo("ShieldThrow")
PLAA A 0 A_JumpIfInventory("ShieldCheck", 1, "ShieldLoop")
Goto ShieldThrow
ShieldThrow:
PLAA A 0 A_TakeInventory("ShieldCheck",999)
PLAA A 0 A_JumpIfNoAmmo("ShieldThrow2")
PLAA A 0 A_FireCustomMissile("PlantBarrier", 0, 1, 0, 0)
Goto ShieldThrow2
ShieldThrow2:
PLAA A 0 A_TakeInventory("PlantWeakener",9999)
PLAA IJ 2
PLAA K 6
PLAA JI 3
PLAA AAAA 1 
goto Ready+1
NoAmmo:
PLAA A 0 ACS_Execute(979,0)
PLAA A 0 A_TakeInventory("PlantWeakener", 1)
PLAA A 1 A_TakeInventory("ShieldCheck",999)
PLAA A 0 A_Refire
goto Ready+1
}
}

actor PlantWeakener : PowerProtection
{
damagefactor "normal", 1.3
powerup.duration 0x7fffffff
}

actor PlantBarrierWarper : BaseShieldWarper
{
	States
	{
	Shield:
	PLAN ABCDEFGHIJKLMNOPQR 1 A_Warp(AAPTR_TARGET, 0, 0, 0, 0, WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
	loop
	}
}

actor PlantBarrierHealer : CustomInventory
{
	States
	{
	Pickup:
		TNT1 A 0 A_JumpIf(health >= 100, "Failed")
		TNT1 A 0 A_JumpIfInventory("PlantBarrierAmmoCooldown", 1, "Heal")
		TNT1 A 0 A_GiveInventory("PlantBarrierAmmoCooldown", 1)
		TNT1 A 0 A_TakeInventory("PlantBarrierAmmo",1,TIF_NOTAKEINFINITE)
		goto Heal
	Heal:
		TNT1 A 0 HealThing(1)
		stop
	Failed:
		TNT1 A 0
		stop
	}
}

actor PlantBarrierAmmoCooldown : Powerup
{
	powerup.duration 10
}

/*
actor PlantBarrier1
{
scale 2.5
- SOLID
+NOGRAVITY
+CLIENTSIDEONLY
+NOTIMEFREEZE
States
{
Spawn:
PLAN A 1
PLAN A 1
stop
}
}

actor PlantBarrier2 : PlantBarrier1
{
States
{
Spawn:
PLAN B 1
PLAN B 1
stop
}
}

actor PlantBarrier3 : PlantBarrier1
{
States
{
Spawn:
PLAN C 1
PLAN C 1
stop
}
}

actor PlantBarrier4 : PlantBarrier1
{
States
{
Spawn:
PLAN D 1
PLAN D 1
stop
}
}

actor PlantBarrier5 : PlantBarrier1
{
States
{
Spawn:
PLAN E 1
PLAN E 1
stop
}
}

actor PlantBarrier6 : PlantBarrier1
{
States
{
Spawn:
PLAN F 1
PLAN F 1
stop
}
}

actor PlantBarrier7 : PlantBarrier1
{
States
{
Spawn:
PLAN G 1
PLAN G 1
stop
}
}

actor PlantBarrier8 : PlantBarrier1
{
States
{
Spawn:
PLAN H 1
PLAN H 1
stop
}
}

actor PlantBarrier9 : PlantBarrier1
{
States
{
Spawn:
PLAN I 1
PLAN I 1
stop
}
}

actor PlantBarrier10 : PlantBarrier1
{
States
{
Spawn:
PLAN J 1
PLAN J 1
stop
}
}

actor PlantBarrier11 : PlantBarrier1
{
States
{
Spawn:
PLAN K 1
PLAN K 1
stop
}
}

actor PlantBarrier12 : PlantBarrier1
{
States
{
Spawn:
PLAN L 1
PLAN L 1
stop
}
}

actor PlantBarrier13 : PlantBarrier1
{
States
{
Spawn:
PLAN M 1
PLAN M 1
stop
}
}

actor PlantBarrier14 : PlantBarrier1
{
States
{
Spawn:
PLAN N 1
PLAN N 1
stop
}
}

actor PlantBarrier15 : PlantBarrier1
{
States
{
Spawn:
PLAN O 1
PLAN O 1
stop
}
}

actor PlantBarrier16 : PlantBarrier1
{
States
{
Spawn:
PLAN P 1
PLAN P 1
stop
}
}

actor PlantBarrier17 : PlantBarrier1
{
States
{
Spawn:
PLAN Q 1
PLAN Q 1
stop
}
}

actor PlantBarrier18 : PlantBarrier1
{
States
{
Spawn:
PLAN R 1
PLAN R 1
stop
}
}
*/

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

actor PlantBarrier
{
scale 2.5
PROJECTILE
+DONTSPLASH
Damage (33)
damagetype "PlantBarrier"
Obituary "$OB_PLANTBARRIER"
Speed 32
Radius 12
Height 12
States
{
Spawn:
PLAN ABCDEFGHIJKLMNOPQR 1
loop
}
}