actor PlantTrapperWep_NormalBar : NormalBar { args 104, 60 }

actor PlantTrapperWep : BaseMM8BDMWep
{
Weapon.AmmoUse 1
Weapon.AmmoGive 112
Weapon.SlotNumber 3
Inventory.Pickupmessage "$PU_PLANTTRAPPER"
Obituary "$OB_PLANTTRAPPER"
Tag "$TAG_PLANTTRAPPER"
weapon.ammotype "PlantTrapperAmmo"
inventory.icon "XTR0WI_O"
States
{
SpawnLoop:
XWI0 O -1
loop

Deselect:
XH0O A 0
goto DeselectSwap
Select:
XH0O A 0
goto SelectSwap

Ready:
XH0O A 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_PLANTTRAPPER)
XH0O A 1 A_WeaponReady
wait

Fire:
XH0O A 0 A_JumpIfNoAmmo("NoAmmo")
XH0O A 0 A_PlaySoundEx("weapon/mbuster","Weapon")
XH0O B 2 A_FireCustomMissile("PlantTrapperShot",0,1,8,0)
XH0O A 2
XH0O A 0 A_Refire
Goto Ready+1
Hold:
XH0O A 0 A_JumpIfNoAmmo("NoAmmo")
XH0O A 0 A_PlaySoundEx("weapon/mbuster","Weapon")
XH0O C 2 A_FireCustomMissile("PlantTrapperShot",random(-5,5),1,8,0)
XH0O A 2
XH0O A 0 A_Refire(1)
Goto Ready+1
XH0O A 0 A_JumpIfNoAmmo("NoAmmo")
XH0O A 0 A_PlaySoundEx("weapon/mbuster","Weapon")
XH0O B 2 A_FireCustomMissile("PlantTrapperShot",random(-5,5),1,8,0)
XH0O A 2
XH0O A 0 A_Refire
Goto Ready+1
NoAmmo:
XH0O A 1 ACS_NamedExecuteAlways("core_noammo",0)
Goto Ready+1
}
}

actor PlantTrapperAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 112
+INVENTORY.IGNORESKILL
}

actor PlantTrapSlowGiver : PowerApropGiver {}
actor PlantTrapSlow : PowerSpeed
{
powerup.duration -2
speed 1.0//speed 0.5
}

actor PlantTrapperShot : ProjSpawnFuncActor
{
PROJECTILE
damagetype "PlantTrapper"
Obituary "$OB_PLANTTRAPPER"
-NOGRAVITY
+BOUNCEONWALLS
+FORCEXYBILLBOARD
+BRIGHT
wallbouncefactor 0.12
Damage (80)
radius 10
height 5
Speed 43
scale 2.5
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_ChangeVelocity(0,0,2)
XH0O S 0
XH0O S 1
wait
Crash:
XDeath:
XH0O S 1
stop
Death:
XH0O S 0 A_JumpIf(z-floorz>0, "Crash")
XH0O S 1 A_SpawnItemEx("PlantTrapperTrap")
stop
}
}

actor PlantTrapperTrap : ProjSpawnFuncActor
{
PROJECTILE
damagetype "PlantTrapper2"
Obituary "$OB_PLANTTRAPPER"
+DONTBLAST
+DONTREFLECT
+THRUACTORS
+HITTRACER
ReactionTime 1
damage (80)
radius 32
height 32
scale 1.8
states
{
Spawn:
TNT1 A 1
TNT1 A 1 A_ChangeFlag("FLOORHUGGER",1)
XH0O R 12
XH0O Q 12 A_ChangeFlag("THRUACTORS",0)
XH0O P 93
XH0O P 1 A_CountDown
wait
Death:
Fade:
XH0O PPPQQQRRR 1 A_FadeOut(0.1)
stop
XDeath:
Crash:
XH0O R 0 A_JumpIf(CallACS("cbm_istracerally")==1, "Fade")
XH0O R 0 //A_PlaySoundEx("weapon/slashclawhit","Weapon")
XH0O R 35 A_GiveInventory("PlantTrapSlowGiver",1,AAPTR_TRACER)
XH0O RRRRRRRR 1 A_FadeOut(0.15)
stop
}
}

