Actor DarkCowboy : PistolZombie
{
//Creator: Fluffy
//Origin: Nexus Infinity
//Sprite: DCO1/DCO2
//Title: "Dark Cowboy"
Health 357
Speed 4
PainChance 120
DropItem "PortableMedCell", 150, 1
DropItem "StimKit", 180, 2
DropItem "Bulletmag", 180
DropItem "HealthFlask", 200, 6
DropItem "ArmorPlate", 160
Dropitem "MarineBeacon", 60, 1
DropItem "HandGrenadeAmmo", 120, 1
DropItem "MineAmmo", 90, 1
DropItem "AmmoPack", 160, 1
DropItem "HellseconomicContract", 115
Species "SpecOps"
SeeSound "darkcowboy/sight"
Painsound "darkcowboy/pain"
Deathsound "darkcowboy/death"
ActiveSound "darkcowboy/active"
AttackSound "weapons/revolver"
Obituary "%o wasn't as quick to draw %p gun as the \c[a4]Dark Cowboy\c- was."
Tag "\c[a4]Dark Cowboy\c-"
-NOFEAR
var int user_missile;
var int user_stamina;
States
{
  Spawn:
	DCO1 A 10 A_Look
	DCO2 A 10 A_Look
	Loop
  See:
	DCO1 AAAABBBB 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("CowboyStep",0,0,5,0,0,-20)
	DCO1 CCCCDDDD 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("CowboyStep",0,0,5,0,0,-20)
	Loop
  Missile:
    TNT1 A 0 A_Jump(100,"Dodge")
  Revolver:
	DCO1 EE 6 A_FaceTarget
	DCO1 F 4 BRIGHT A_CustomBulletAttack (4, 0, 1, random(1,5) * 5, "ModdedBulletPuff", 0, CBAF_NORANDOM)
	DCO1 E 6 A_SpawnItemEx("BulletCasing",30,0,30,Random(2,4),Random(3,6),Random(3,6),0)
	DCO1 F 4 BRIGHT A_CustomBulletAttack (10.5, 0, 1, random(1,5) * 5, "ModdedBulletPuff", 0, CBAF_NORANDOM)
	DCO1 E 6 A_SpawnItemEx("BulletCasing",30,0,30,Random(2,4),Random(3,6),Random(3,6),0)
	DCO1 F 4 BRIGHT A_CustomBulletAttack (22.5, 0, 1, random(1,5) * 5, "ModdedBulletPuff", 0, CBAF_NORANDOM)
	DCO1 E 6 A_SpawnItemEx("BulletCasing",30,0,30,Random(2,4),Random(3,6),Random(3,6),0)
	Goto See
  Pain:
	DCO1 G 3 A_Pain
	DCO1 G 2 A_Jump(80,"Dodge")
	Goto see
  Dodge:
	DCO1 A 1 A_FaceTarget
	TNT1 A 0 A_JumpIf(user_stamina >= 3,"Revolver")
	TNT1 A 0 A_ChangeFlag(NOPAIN,1)
	TNT1 A 0 A_SetUserVar(user_missile,0)
    TNT1 A 0 A_jump(128,3)
	TNT1 A 0 ThrustThing(angle*256/360+192, Random(10,15), 0, 0)
	TNT1 A 0 A_jump(256,2)
	TNT1 A 0 ThrustThing(angle*256/360+64, Random(10,15), 0, 0)
  ContinueDodgeLoop:
    DCO1 A 1 A_FaceTarget
	TNT1 A 0 A_CheckSight("See")
    TNT1 A 0 A_JumpIf(user_missile >= 20,"ContinueDodgeEnd")
	TNT1 A 0 A_SetUserVar(user_missile,user_missile+random(1,5))
	Loop
  ContinueDodgeEnd:
	TNT1 A 0 A_ChangeFlag(NOPAIN,0)
	DCO1 A 5 A_SetUserVar(user_stamina,user_stamina+1)
	DCO1 A 1 A_JumpIfTargetInLOS("Revolver")
	Goto See
  Death:
	DCO1 H 5 A_StopSound(6)
	DCO1 I 5 A_Scream
	DCO1 J 5 A_Fall
	TNT1 A 0 A_SpawnItemEx(".357 Revolver",0,0,8,random(0,3),random(0,3),4,random(0,360),0,160)
	DCO1 K 5 A_SpawnItem("BodyCrash",0,0,0,0)
	DCO1 L 63000 CanRaise
	Stop
  XDeath:
	TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_SpawnItemEx("GibbedGenerator",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
	DCO1 M 5 A_GiveInventory("XDeathCheck",1)
	DCO1 N 5 A_XScream
	POSS O 5 A_Fall
	TNT1 P 0 A_SpawnItemEx(".357 Revolver",0,0,8,random(0,3),random(0,3),4,random(0,360),0,160)
	POSS QRST 5
	POSS U 63000 CanRaise
	Stop
  Raise:
	TNT1 A 0
	TNT1 A 0 A_SpawnItemEx("VileHealEffect",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION)
	POSS LKJIH 5
	Goto See
	}
}

Actor CowboyStep : FootStep2 { Deathsound "darkcowboy/footstep" }