//===========================================================================
//
// Cacodemon
//
//===========================================================================
ACTOR 42MAN //3002
{
	Game Doom
	
		var int user_delay42MANatk;	

	SpawnID 8
	Health 250
	PainChance 45
	Speed 12
	Radius 30
	Height 56
	Mass 400
	Monster
Translation "112:127=[0,0,128]:[0,0,0]"
	+FLOORCLIP +FASTER +FASTMELEE
        SeeSound "Gensight"
        PainSound "Genpain"
        DeathSound "Gendeath"
        ActiveSound "Genactive"

	AttackSound "SSG08/FIRE"//"W42F"
	Obituary "$OB_DEMONHIT"
	DropItem "DropSpawner5", 128
	DropItem "DeadClip5Inv", 160
	Species "SniperMan"
	States
	{
	Spawn:
		PHOB AB 10 A_Look
		Loop


	See:
		TNT1 A 0 A_JumpIf(user_delay42MANatk<1,"See_atk")

	See_noatk:
		PHOB AABBCCDD 3 A_Chase("","")
TNT1 A 0 A_SetUserVar(user_delay42MANatk,user_delay42MANatk-1)
		Loop

	See_atk:
		PHOB AABBCCDD 3 A_Chase
TNT1 A 0 A_SetUserVar(user_delay42MANatk,user_delay42MANatk-1)
		Loop
		
		
	Missile:
                PHOB E 10 A_FaceTarget
		TNT1 A 0 A_PlaySound("SSG08/Distant", 7)

		TNT1 A 0 A_PlaySound("SSG08/FIRE", CHAN_WEAPON)
		TNT1 A 0 A_CustomBulletAttack(15.5, 0, 1, random(4,8)*3, "BulletPuff", 0, CBAF_NORANDOM)		
		TNT1 A 0 A_CustomMissile("Tracer_Monster",36,5,FRandom(-8,8),CMF_OFFSETPITCH,FRandom(-5,5))		
		TNT1 A 0 A_SetUserVar(user_delay42MANatk,4)
		
//TNT1 A 0 A_ChangeFlag("NOPAIN", true)

                PHOB F 5 BRIGHT //A_CPosAttack
                PHOB F 10
//B42G A 0 A_PlaySoundEx("W42FB","soundslot5",0)
                PHOB D 12 
                PHOB E 10 
//TNT1 A 0 A_ChangeFlag("NOPAIN", false)
		Goto See
	Pain:
		PHOB G 3
		PHOB G 3 A_Pain
		Goto See

	Pain.FLASHBANGFREEZE:
TNT1 A 0 A_ChangeFlag("NOPAIN", true)
		PHOB G 2
		PHOB G 175 A_Pain
TNT1 A 0 A_ChangeFlag("NOPAIN", false)
		Goto See

	Death:
//TNT1 A 0 A_GiveToTarget("MoneySystem", 250)

		PHOB H 5
		PHOB I 5 A_Scream
		PHOB J 5 A_NoBlocking
		PHOB K 4
		PHOB L 4 
		PHOB M 4
		PHOB N -1
		Stop





XDeath:
//TNT1 A 0 A_GiveToTarget("MoneySystem", 500)
PHOB O 0 A_SpawnItemEx("NashGore_GibPieceGenerator11",0,0,0,0,0,0,0,128)
PHOB O 0 A_SpawnItemEx("NashGore_GibPieceGenerator11",0,0,0,0,0,0,0,128)
PHOB O 0 A_SpawnItemEx("NashGore_GibPieceGeneratorSARG",0,0,0,0,0,0,0,128)
PHOB O 0 A_SpawnItemEx("NashGore_GibGenerator",0,0,0,0,0,0,0,128)
PHOB O 0 A_SpawnItemEx("NashGore_GibGenerator",0,0,0,0,0,0,0,128)
PHOB O 5
PHOB O 0 A_SpawnItemEx("NashGore_GibGenerator",0,0,0,0,0,0,0,128)
PHOB P 5 A_playsound("demon/xdeath")
PHOB P 0 A_SpawnItemEx("NashGore_GibGenerator",0,0,0,0,0,0,0,128)
PHOB Q 5
PHOB Q 0 A_SpawnItemEx("NashGore_GibGenerator",0,0,0,0,0,0,0,128)
PHOB R 5 A_NoBlocking
PHOB STUV 5
PHOB W -1
stop
	Raise:
		PHOB N 5
		PHOB MLKJI 5
		Goto See
	}
}