ACTOR HeadlessZombie: RifleZombie
{
Health 150
Speed 4
FastSpeed 8
deathsound "none"
seesound "none"
	States
	{
	Spawn:
		PONH B 0
		PONH B 1
	Goto Stand
	
	Stand:
	sTAND2:
		PONH A 11 A_Look
		Loop
	
	SearchForPlayer:
	Idle:
	    TNT1 A 0 A_ClearTarget
	    TNT1 A 0 A_TakeInventory("EnemyMemory", 30)
		TNT1 A 0 A_GiveInventory("SKZombieMan", 1)
        //TNT1 A 0 A_SpawnItem ("HeadshotTarget10", 10, 44,0)
		TNT1 A 0 //A_SpawnItem ("LegTargetBase", 10)
		PONH A 10 A_Look
        //TNT1 A 0 A_SpawnItem ("HeadshotTarget10", 10, 44,0)
		TNT1 A 0 //A_SpawnItem ("LegTargetBase", 10)
		PONH A 10 A_Look
		//TNT1 A 0 A_SpawnItem ("HeadshotTarget10", 10, 44,0)
		TNT1 A 0 //A_SpawnItem ("LegTargetBase", 10)
		PONH A 10 A_Look
        //TNT1 A 0 A_SpawnItem ("HeadshotTarget10", 10, 44,0)
		TNT1 A 0 //A_SpawnItem ("LegTargetBase", 10)
		PONH A 10 A_Look
		//TNT1 A 0 A_SpawnItem ("HeadshotTarget10", 10, 44,0)
		TNT1 A 0 //A_SpawnItem ("LegTargetBase", 10)
		PONH A 10 A_Look
		//TNT1 A 0 A_SpawnItem ("HeadshotTarget10", 10, 44,0)
		TNT1 A 0 //A_SpawnItem ("LegTargetBase", 10)
		PONH A 10 A_Look
		//TNT1 A 0 A_SpawnItem ("HeadshotTarget10", 10, 44,0)
		TNT1 A 0 //A_SpawnItem ("LegTargetBase", 10)
		PONH A 10 A_Look
		
	StartSearching:	
		PONH A 2 A_Look
		//TNT1 A 0 A_SpawnItem ("HeadshotTarget4", 10, 44,0)
		TNT1 A 0 A_Wander
		PONH A 2 A_Look
		TNT1 A 0 A_Wander
		
		PONH B 2 A_Look
		//TNT1 A 0 A_SpawnItem ("HeadshotTarget4", 10, 44,0)
		TNT1 A 0 A_Wander
		PONH B 2 A_Look
		TNT1 A 0 A_Wander
		
		
		PONH C 2 A_Look
		//TNT1 A 0 A_SpawnItem ("HeadshotTarget4", 10, 44,0)
		TNT1 A 0 A_Wander
		PONH C 2 A_Look
		TNT1 A 0 A_Wander
		
		PONH D 2 A_Look
		//TNT1 A 0 A_SpawnItem ("HeadshotTarget4", 10, 44,0)
		TNT1 A 0 A_Wander
		PONH D 2 A_Look
		TNT1 A 0 A_Wander
		
		
		TNT1 A 0 A_Jump(64, "Idle")
		Goto StartSearching
		
	
	See:
		TNT1 A 0 A_ChangeFLag("NODROPOFF", 0)
		TNT1 A 0 A_TakeInventory("SKZombieman", 1)
		TNT1 A 0 A_TakeInventory("EnemyMemory", 15)
		TNT1 A 0 A_CheckSight("SeeNeverSeen")
		TNT1 A 0 A_TakeInventory("SKZombieman", 1)
		Goto SeeContinue
		
		
	Pain.Cut:
	Pain.Saw:
		TNT1 A 0
		TNT1 A 0 A_Stop
	Pain:	
		PONH G 4
		Goto See
		
	Pain.Kick:
		PONH G 1 A_FaceTarget
		TNT1 A 0 ThrustThingZ(0,20,0,1)
        PONH G 3 ThrustThing(angle*256/360+128, 10, 0, 0)
		PONH G 6
		Goto See
		
	Pain.Melee:
		PONH G 1 A_FaceTarget
		TNT1 A 0 ThrustThingZ(0,10,0,1)
        PONH G 3 ThrustThing(angle*256/360+128, 10, 0, 0)
		PONH G 2
		Goto See	
	
	SeeContinue:
		Advance:
		TNT1 A 0 A_ChangeFLag("NODROPOFF", 0)
        //TNT1 A 0 A_SpawnItemEx("FootSep", 0, 0, 10, 0, 0)
		TNT1 A 0 A_JumpIfInventory("EnemyMemory", 15, "SearchForPlayer")
		TNT1 A 0 A_GiveInventory("EnemyMemory", 1)
		
		PONH AAAA 2 A_Chase
		
		PONH BBBB 2 A_Chase
		
		PONH CCCC 2 A_Chase
		
		PONH DDDD 2 A_Chase
		
		TNT1 A 0 A_JumpIfInTargetInventory("IsInvisible", 1, "Idle")
		Loop
		
	SeeNeverSeen:
	Advance:
		TNT1 A 0 A_ChangeFLag("NODROPOFF", 0)
		

		PONH AA 2 A_Chase
		
		PONH BB 2 A_Chase
	
		PONH CC 2 A_Chase
		
		PONH DD 2 A_Chase
		TNT1 A 0 A_CheckSIght("SeeNeverSeen")
		Goto SeeContinue
		
	Missile:
	    TNT1 A 0 A_Stop
		
		TNT1 A 0 A_ChangeFlag("GHOST", 0)
		TNT1 A 0 A_ChangeFLag("NODROPOFF", 0)
		TNT1 A 0 A_TakeInventory("SKZombieman", 1)
		TNT1 A 0 A_TakeInventory("EnemyMemory", 10)
		
        //TNT1 A 0 A_Jump(8, "Grenade")
		//TNT1 A 0 A_SpawnItem ("HeadshotTarget20", 0, 40,0)
		TNT1 A 0 //A_SpawnItem ("LegTarget20", 10)
		
		//TNT1 A 0 A_TakeInventory("CantFire", 1)
		//TNT1 A 0 A_CustomMissile("MonsterTargetCheck", 34, 0, 0, 0) 
		//TNT1 A 0 A_CustomMissile("MonsterTargetCheckFaster", 34, 0, 0, 0)  
		PONH E 10 A_FaceTarget
		
		FireDamnGun:
        TNT1 A 0 A_CustomMissile("OrangeLensFlareAlt", 32, 20, 15, 0)
        TNT1 A 0 A_PlaySound("weapons/rifle")
		TNT1 A 0 A_CustomMissile("DistantFireSoundRifle", 32, 0, 0, 1, 0)
		PONH F 2 BRIGHT A_CustomMissile("ZombieManTracer", 32, 0, random(-8, 8), 1, random(-3, 3))
		TNT1 A 0 A_SpawnItem ("RifleCaseSpawn", 0, 30,0)
		PONH E 5 A_FaceTarget
		TNT1 A 0 A_Jump(128, "FireDamnGun")
       
       TNT1 A 0 A_JumpIfInTargetInventory("IsInvisible", 1, "SearchForPlayer")
        Goto SeeContinue
		
		
	

   Pain.Avoid:
	    TNT1 A 0
	    TNT1 A 0
		Goto SeeContinue
	  
  
	Death.Fatality:
		TNT1 A 0
		GOto XDeath
		
	Death.Shotgun:
	Death.Minigun:
	Death.Blast:
	Death.SSG:
	Death.SSG:
	    TNT1 AAA 0 A_CustomMissile ("XDeath1", 32, 0, random (0, 360), 2, random (0, 40))
		TNT1 AA 0 A_CustomMissile ("XDeath2b", 32, 0, random (0, 360), 2, random (0, 40))
		TNT1 AA 0 A_CustomMissile ("XDeath3b", 32, 0, random (0, 360), 2, random (0, 40))
		TNT1 A 0 A_CustomMissile ("MuchBlood", 42, 0, random (0, 360), 2, random (0, 40))
		TNT1 A 0 A_CustomMissile ("MeatDeath", 42, 0, random (0, 360), 2, random (0, 40))
		TNT1 A 0 A_SpawnItem("Muchblood2", 0, 30)
		
		TNT1 AA 0 A_CustomMissile ("XDeathArm1", 32, 0, random (0, 360), 2, random (0, 40))
		TNT1 A 0 A_SpawnItem("RipGuts", 0, 32)
        TNT1 A 0 A_XScream
		TNT1 A 0 A_NoBlocking
        ZZD1 EEFFGH 6
		TNT1 A 0 A_SpawnItem ("GrowingBloodPool")
		ZZD1 H 0
		TNT1 A 0 A_SpawnItem("DeadZombiemanJustLegsAreLeft2")
        Stop
		
	Death.Cut:
	Death.Saw:
		TNT1 A 0
		Goto XDeath	
		
	Death:
	Death.Kick:
	Death.Melee:
	Death.Minor:
		TNT1 AA 0 A_CustomMissile ("Brutal_FlyingBlood", 7, 0, random (0, 360), 2, random (0, 160))
		PONH G 8 A_NoBlocking
		PONH H 5 A_Scream
		PONH I 5 
		PONH JK 5
		TNT1 A 0 A_SpawnItem ("GrowingBloodPool")
        PONH L 0
		TNT1 A 0 A_SpawnItem("DeadZombieman1")
		TNT1 A -1
		Stop	
	}
}