ACTOR ZamasySentryBox : CustomInventory
{
  +COUNTITEM
  +FLOORCLIP
  +INVENTORY.INVBAR
  +INVENTORY.HUBPOWER
  +INVENTORY.PERSISTENTPOWER
  +INVENTORY.BIGPOWERUP
  Inventory.Amount 1
  Inventory.MaxAmount 4
  Inventory.InterHubAmount 4
  Inventory.Icon "ZTPLF0"
  Inventory.PickupMessage "\c[s5]Zamasu Sentry Gun\c-!"
  Inventory.PickupSound "DTechSentry/pickup"
  Inventory.UseSound "DTechSentry/use"
  Tag "Zamasu Sentry Gun"
 States
  {
  Spawn:
    ZSTZ A -1
    Stop
  Use:
	TNT1 A 0
	TNT1 A 0 A_SpawnItemEx("ZamasuFriendlyTurret",56,0,8,0,0,0,0,1,0,tid-1)
	Stop
	TNT1 A 1
	Fail	
  }
}

Actor ZamasuFriendlyTurret
{
Obituary "%o was betrayed by an Sentry Gun."
Tag "\c[s5]Zamasu Sentry Gun\c-"
Health 1250
Radius 16
Height 56
Mass 100000
Speed 0
Monster
Decal "NemesisShellCasing"
DropItem "NLDemonAmmoBox", 256 
DropItem "NLDemonAmmo", 256 

+FLOORCLIP
+FRIENDLY
+MISSILEMORE
+MISSILEEVENMORE
+NOTARGET
+QUICKTORETALIATE
+NOBLOOD
+LOOKALLAROUND
+DROPOFF
+STANDSTILL
+NOTIMEFREEZE
Species "Player"
  DamageFactor "Player", 0.0
  DamageFactor "Players", 0.0
  DamageFactor "PlayerNemesisPlasma", 0.0
  DamageFactor "PlayerDevTracer", 0.0
  DamageFactor "PlayerExplosive", 0.0
  DamageFactor "PlayerDTRG", 0.0
  DamageFactor "DTRailgun", 0.0
  DamageFactor "PDTBFGTracer", 0.0
  DamageFactor "LegendaryPlayer", 0.0
  DamageFactor "LegendaryGuruPlayer", 0.0
  DamageFactor "PDTPuff", 0.0
  DamageFactor "PlayerTear", 0.0
  DamageFactor "PlayerDBFG2", 0.0
  DamageFactor "PlayerDBFG10K2", 0.0
  DamageFactor "PlayerDevBall", 0.0
  DamageFactor "PlayerDevBall2", 0.0
  DamageFactor "PDTBFG", 0.0
  DamageFactor "DiscoBFG", 0.0
  DamageFactor "PlayerDemonicSkill", 0.0
  //Friendly Monsters
  DamageFactor "AllyRail", 0.0
  DamageFactor "AllyDTRG", 0.0
  DamageFactor "AllyDTRailgun", 0.0
  DamageFactor "AllyExplosion", 0.0
  DamageFactor "AllyDTPuff", 0.0
  DamageFactor "AllyDBFG", 0.0
  DamageFactor "FriendlyMonster", 0.0
  DamageFactor 0.4
  AttackSound "sentry/attack"
  DeathSound "sentry/die"
var int user_TurretLoop;
States
{
  Spawn:
  See:
	TNT1 A 0 A_SetUserVar(user_TurretLoop,0)
    ZTUR AAAAAAAAAAAAAAA 1 A_Chase
	TNT1 A 0 A_SpawnItem("NemesisHellionSmokeSpawner")
    TNT1 A 0 A_PlaySound("ZTURry/beep")
	TNT1 A 0 A_ClearTarget
    Loop
  Missile:
  TurretLoopStart:
	TNT1 A 0 A_JumpIf(user_TurretLoop == 15,"TurretLoop")	
	TNT1 A 0 A_FaceTarget
	ZTUR A 1 A_CustomRailgun(-1,0,NONE,NONE,RGF_SILENT|RGF_NOPIERCING,1,0,RailTargetPuff,0,0,0,0,2,0,"NemesisTracer",5)  
	TNT1 A 0 A_SetUserVar(user_TurretLoop,user_TurretLoop+1)
	Loop
  TurretLoop:
    ZTUR A 1 A_CustomRailgun(-1,0,NONE,NONE,RGF_SILENT|RGF_NOPIERCING,1,0,RailTargetPuff,0,0,0,0,2,0,"NemesisTracer",5)  
	TNT1 A 0 A_FaceTarget
	ZTUR A 1 A_CustomRailgun(-1,0,NONE,NONE,RGF_SILENT|RGF_NOPIERCING,1,0,RailTargetPuff,0,0,0,0,2,0,"NemesisTracer",5)  
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_CustomMissile("NemesisZombieCannonLaser",Random(38,42),0,Random(5,-5),0)
	TNT1 A 0 A_PlaySound("weapons/LMGFire")
    TNT1 A 0 A_SpawnItemEx("ELegRifleCasing", 12, 6, 30, Random(2, 6), 0, Random(1, 3), Random(-80, -90), 128)
    TNT1 A 0  A_CustomBulletAttack(32,5,1,random(10,15)*3,"EnragedBulletPuff")
    ZTUR B 1 Bright A_CustomRailgun(-1,0,NONE,NONE,RGF_SILENT|RGF_NOPIERCING,1,0,RailTargetPuff,0,0,0,0,2,0,"NemesisTracer",5)
	TNT1 A 0 A_SpawnItem("NemesisHellionSmokeSpawner")
    TNT1 A 0 A_CPosRefire 
    Loop
  Death:
	TNT1 A 0 A_SpawnItemEx("EnragedParticleSpawner") 
    TNT1 AAA 0 A_CustomMissile("EKaboomLN", 0, 0, random(0,360), 2, random(0,360))
	TNT1 AAA 0 A_CustomMissile("LegendarySmokeFX2", 0, 0, random(0,360), 2, random(0,360))
    TNT1 AAAA 0 A_SpawnItemEx("LegendaryDebris",0,0,0,Random(4,-4),Random(4,-4),Random(4,8),0,128)
    TNT1 A 0 A_PlaySound("weapons/rocklx")
    TNT1 A 1 A_SpawnItem("RocketEx",0,32)
    Stop
  }
}