actor PlantBarrierWepSH : BaseMM8BDMWep
{
//$Category MM8BDM-Weapons
//$Title Plant Pasture
Weapon.AmmoUse 4
Weapon.AmmoGive 28
Weapon.SlotNumber 2
Inventory.Pickupmessage "$PU_PLANTBARRIER"
Obituary "$OB_PLANTBARRIER"
Tag "$TAG_PLANTBARRIER"
weapon.ammotype "PlantBarrierAmmo"
inventory.icon "PLANTSI"
+INVENTORY.RESTRICTABSOLUTELY Inventory.RestrictedTo megamans
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:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
PLAA A 1 A_Lower
loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
PLAA A 1 A_Raise
Loop
Fire:
PPST B 0 A_JumpIfNoAmmo("NoAmmo")
PPST B 0 A_PlaySoundEx("weapon/mbuster","Weapon")
PPST B 0 A_FireCustomMissile("PlantPastureBomb",0,1,8,0)
PPST CDEFGH 3
PLAA A 3 Offset(0,42)
PLAA A 3 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
PLAA A 0 
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 PlantPastureBomb
{
PROJECTILE
Radius 16
Height 16
Scale 3.0
Damage (13)
-NOGRAVITY
+DONTSPLASH
+HEXENBOUNCE
Damagetype "PlantBarrier"
Obituary "$OB_PlantBarrier"
reactiontime 33
	Translation "198:198=39:39", "192:192=4:4"
Speed 22
States
{
Spawn:
TNT1 A 0
PBUS X 0 A_Countdown
PBUS XX 1 A_SpawnItemEx("PlantPasturePetalFX_1")
PBUS X 0 A_Countdown
PBUS YY 1 A_SpawnItemEx("PlantPasturePetalFX_2")
loop
Death:
HARD B 0 A_SpawnItemEx("PlantPastureShield")
HARD BCDE 1 A_PlaySoundEx("weapon/leafshield","Weapon",0)
stop
}
}

actor PlantPastureShield //: LeafShield
{
scale 2.0
PROJECTILE
+NOEXPLODEFLOOR
+NOGRAVITY
+NOINTERACTION
Damage(0)
Obituary "$OB_PlantBarrier"
damagetype "PlantPasture"
Radius 110
Height 110
Speed 0
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_PlaySoundEx("weapon/leafshield","Weapon",0)
TNT1 AAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("PlantPetal2",random(2,111),0,random(-55,111),0,0,0,frandom(0,360))
TNT1 A 2 A_Explode(7,110,0,0,110)
TNT1 AAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("PlantPetal2",random(2,111),0,random(-55,111),0,0,0,frandom(0,360))
TNT1 A 2 A_Explode(7,110,0,0,110)
TNT1 A 0 A_PlaySoundEx("weapon/leafshield","Weapon",0)
TNT1 AAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("PlantPetal2",random(2,111),0,random(-55,111),0,0,0,frandom(0,360))
TNT1 A 2 A_Explode(7,110,0,0,110)
TNT1 AAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("PlantPetal2",random(2,111),0,random(-55,111),0,0,0,frandom(0,360))
TNT1 A 2 A_Explode(7,110,0,0,110)
TNT1 A 0 A_PlaySoundEx("weapon/leafshield","Weapon",0)
TNT1 AAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("PlantPetal2",random(2,111),0,random(-55,111),0,0,0,frandom(0,360))
TNT1 A 2 A_Explode(7,110,0,0,110)
TNT1 AAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("PlantPetal2",random(2,111),0,random(-55,111),0,0,0,frandom(0,360))
TNT1 A 2 A_Explode(7,110,0,0,110)
TNT1 A 0 A_PlaySoundEx("weapon/leafshield","Weapon",0)
TNT1 AAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("PlantPetal2",random(2,111),0,random(-55,111),0,0,0,frandom(0,360))
TNT1 A 2 A_Explode(7,110,0,0,110)
TNT1 AAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("PlantPetal2",random(2,111),0,random(-55,111),0,0,0,frandom(0,360))
TNT1 A 2 A_Explode(7,110,0,0,110)
TNT1 A 0 A_PlaySoundEx("weapon/leafshield","Weapon",0)
TNT1 A 1
goto Death
Death:
HARD BCDE 1
stop
}
}

actor PlantPasturePetalFX_1
{
Translation "198:198=39:39", "192:192=4:4"
scale 2.5
+NOGRAVITY
+CLIENTSIDEONLY
+MISSILE
+DONTSPLASH
Damage (0)
height 0
radius 0
reactiontime 10
States
{
Spawn:
PBUS X 0
PBUS X 0 A_SetScale(scaleX-0.1)
PBUS X 0 A_SetScale(scaleY-0.1)
PBUS X 1 A_Countdown//A_Fadeout(0.2)
loop
}
}

actor PlantPasturePetalFX_2 : PlantPasturePetalFX_1
{
States
{
Spawn:
PBUS Y 0
PBUS Y 0 A_SetScale(scaleX-0.1)
PBUS Y 0 A_SetScale(scaleY-0.1)
PBUS Y 1 A_Countdown//A_Fadeout(0.2)
loop
}
}

actor PlantPetal : BasicClientside {
	Translation "198:198=39:39", "192:192=4:4"
	Renderstyle Translucent
	Alpha 0.85
	States
	{
		Spawn:
		TNT1 A 0
		PBUS X 1
		stop
	}
}

actor PlantPetal2 : PlantPetal
{
	+NOINTERACTION
	Alpha 1.0
	Scale 2.5
	States
	{
		Spawn:
		TNT1 A 0
		PBUS X 2 A_Fadeout
		loop
	}
}

actor PlantBarrierFXSpawnerP : CustomInventory
{
	States
	{
		Pickup:
			TNT1 AAAAAA 0 A_SpawnItemEx("PlantPetal2",32,0,random(2,48),0,0,0,frandom(0,360))
			stop
	}
}


Actor PlantPastureWepSH : PlantBarrierWepSH {} 
