ACTOR CorruptedCowboy : LegendaryCowboy 18556
{
//Creator: Makarov and Nemesiscaptain(uwu)
//Origin: Infinity GODS
//Sprite: CWGUA1
//Title: "Corrupted Cowboy"
    Health 1100 //999
    Speed 12
    PainChance 20
    MONSTER
    AttackSound "REVFIRE"
    SeeSound "LegendaryCowboy/See"
    PainSound "LegendaryCowboy/pain"
    DeathSound "LegendaryCowboy/death"
    ActiveSound "LegendaryCowboy/active"
    Obituary "%o wasn't ready to draw and gibbed by Corrupted Cowboy"
	BloodColor "Blue"
	var int user_music;
	var int user_protection;
	var int user_protected;
	DropItem "HandGrenadeAmmo" 256 2
DropItem "MineAmmo" 256 2
DropItem "Backpack" 256 1
DropItem "Armorplate" 256 1
DropItem "Portablemedkit" 256 1
DropItem "CorruptedRevolver" 256 4
DropItem "CorruptedLMGBulletMag" 130
Dropitem "TrueLegendaryWeaponSphereSpawner", 45, 1
Dropitem "MarineSquadBeacon", 30, 1
Dropitem "MarineDBFGBeacon", 10, 1
Dropitem "DCellPack", 128, 30
Dropitem "DCell", 256, 10
Dropitem "DCell", 256, 10
Dropitem "Randomcorrupteditem", 120, 1
DropItem "WeaponEnhancerModuleGiver" 128
	Species "Zombie"
	Tag "\c[o7]Corrupted Cowboy\c-"
	DamageFactor "DBFG10K2",0.0
    DamageFactor "PlayerDBFG10K2",0.05
    DamageFactor "DBFG2",0.0
    DamageFactor "PlayerDBFG2",0.10
	DamageFactor "BFG9500Ball",0.5
    DamageFactor "UpBFG9500Ball",0.5
	DamageFactor 0.9
    States
    {
    Spawn:
	    TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
        CWGU A 10 Bright A_Look
		TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
		CWGU A 10 Bright A_Look
		TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
        Loop
    See:
    TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
    CWGU A 0 A_JumpIfTargetInLOS("Strafing")
    CWGU AA 3 Bright A_Chase
	TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
	CWGU BB 3 Bright A_Chase
	TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	CWGU A 0 A_JumpIfTargetInLOS("Strafing")
	CWGU CC 3 Bright A_Chase
	TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
	CWGU DD 3 Bright A_Chase
	CWGU A 0 A_Jump(80,"Rush")
    TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
    Loop
Rush:
    CWGU A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("CorruptedWESTZombieGhostA",0,0,0,0,0,0,0,128)
	CWGU A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("CorruptedWESTZombieGhostA",0,0,0,0,0,0,0,128)
	CWGU A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("CorruptedWESTZombieGhostB",0,0,0,0,0,0,0,128)
	CWGU B 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("CorruptedWESTZombieGhostB",0,0,0,0,0,0,0,128)
	CWGU B 1 Bright A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
    TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("CorruptedWESTZombieGhostC",0,0,0,0,0,0,0,128)
	CWGU C 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("CorruptedWESTZombieGhostC",0,0,0,0,0,0,0,128)
	CWGU C 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("CorruptedWESTZombieGhostD",0,0,0,0,0,0,0,128)
	CWGU D 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("CorruptedWESTZombieGhostD",0,0,0,0,0,0,0,128)
	CWGU D 1 Bright A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
	TNT1 A 0 A_Jump(84,"See")
	TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
	Loop
Strafing:
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	CWGU AA 3 Bright A_GiveInventory("CorruptedZombieStrafing",1)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	CWGU BB 3 Bright A_GiveInventory("CorruptedZombieStrafing",1)
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
    CWGU CC 3 Bright A_GiveInventory("CorruptedZombieStrafing",1)	
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	CWGU DD 3 Bright A_GiveInventory("CorruptedZombieStrafing",1)
	Goto See
   Missile:
		TNT1 A 0 A_Jump(64,"Multipleshots","SpecialShot") 
        TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
        CWGU EEE 2 Bright A_GiveInventory("CorruptedZombieStrafing",1)
	    TNT1 A 0 A_GiveInventory("CorruptedZombieStrafing",1)
        TNT1 A 0 A_JumpIfInventory ("WESTAmmo", 6, "Reload")
        CWGU E 2 Bright A_FaceTarget
		TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
		TNT1 A 0 A_GiveInventory ("WESTAmmo", 1)
		TNT1 A 0 Bright A_CustomMissile("LaserBeam", 0,0,0,0)
		CWGU F 4 Bright A_CustomBulletAttack(10,5,1,Random(10,40)*2)
		CWGU E 2 Bright A_FaceTarget
		TNT1 A 0 Bright A_CPosRefire
        Goto Missile
	Multipleshots:
	    TNT1 A 0 A_JumpIfInventory ("WESTAmmo", 1, "Reload")
        TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
        CWGU E 3 Bright A_FaceTarget
		TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
		TNT1 A 0 A_GiveInventory ("WESTAmmo", 1)
		TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
		TNT1 A 0 Bright A_CustomMissile("LaserBeam", 0,0,0,0)
		CWGU F 3 Bright A_CustomBulletAttack(10,5,1,Random(10,40)*2)
		CWGU E 3 Bright A_FaceTarget
		TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
		TNT1 A 0 A_GiveInventory ("WESTAmmo", 1)
		TNT1 A 0 Bright A_CustomMissile("LaserBeam", 0,0,0,0)
		CWGU F 3 Bright A_CustomBulletAttack(10,5,1,Random(10,40)*2)
		CWGU E 3 Bright A_FaceTarget
		TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
		TNT1 A 0 A_GiveInventory ("WESTAmmo", 1)
		TNT1 A 0 Bright A_CustomMissile("LaserBeam", 0,0,0,0)
		CWGU F 3 Bright A_CustomBulletAttack(10,5,1,Random(10,40)*2)
		CWGU E 3 Bright A_FaceTarget
        TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
		TNT1 A 0 A_GiveInventory ("WESTAmmo", 1)
		TNT1 A 0 Bright A_CustomMissile("LaserBeam", 0,0,0,0)
		CWGU F 3 Bright A_CustomBulletAttack(10,5,1,Random(10,40)*2)
		CWGU E 3 Bright A_FaceTarget
		TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
		TNT1 A 0 A_GiveInventory ("WESTAmmo", 1)
		TNT1 A 0 Bright A_CustomMissile("LaserBeam", 0,0,0,0)
		CWGU F 3 Bright A_CustomBulletAttack(10,5,1,Random(10,40)*2)
		CWGU E 3 Bright A_FaceTarget
		TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
		TNT1 A 0 A_GiveInventory ("WESTAmmo", 1)
		TNT1 A 0 Bright A_CustomMissile("LaserBeam", 0,0,0,0)
		CWGU F 3 Bright A_CustomBulletAttack(10,5,1,Random(10,40)*2)
		CWGU E 3 Bright A_FaceTarget
		TNT1 A 0 Bright A_CPosRefire 
	SpecialShot:
        TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
        CWGU EEE 2 Bright A_GiveInventory("LegZombieStrafingg",1)
	    TNT1 A 0 A_GiveInventory("LegZombieStrafingg",1)
        TNT1 A 0 A_JumpIfInventory ("LegCowboyAmmo",6,"Reload")
        CWGU E 2 Bright A_FaceTarget
	    TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
	    TNT1 A 0 A_GiveInventory ("LegCowboyAmmo", 1)
	    TNT1 A 0 A_CustomMissile("CorruptedCowboySpecialShot",32,0,0,0)
	    CWGU F 4 Bright
	    CWGU E 2 Bright A_FaceTarget
        Goto See
    Reload:
    	TNT1 A 0 A_ChangeFlag("NoPain", 1)
    	TNT1 A 0 A_PlaySound("REVOPEN")
		TNT1 AAAAAA 0 A_SpawnItemEx("LEGBulletCasing", -8, 7, 30, 4, 0, (0.1)*Random(30, 40), Random(-80, -90), 128)
		TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
    	CWGU E 24 Bright A_TakeInventory ("WESTAmmo", 6)
		TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
    	CWGU E 12 Bright A_PlaySound("REVINSR") 
		CWGU E 12 Bright A_PlaySound("REVCLOSE")
		TNT1 A 0 A_SpawnItem("LHellionSmokeSpawner",0,0,0,0)
	    CWGU E 1 Bright A_PlaySound("REVSPIN")
    	TNT1 A 0 A_ChangeFlag("NoPain", 0)
    	Goto See
Pain:
    TNT1 A 0 A_Jump(50,"Protection")
	TNT1 A 0 A_Jump(192,"PainMissile")
    CWGU G 3 Bright A_GiveInventory("CorruptedZombieStrafing",1)
    CWGU G 0 A_Pain
	CWGU G 3 Bright A_GiveInventory("CorruptedZombieStrafing",1)
    Goto See
PainMissile: 
    CWGU G 3 Bright A_GiveInventory("CorruptedZombieStrafing",1)
    CWGU G 0 A_Pain
	CWGU G 3 Bright A_GiveInventory("CorruptedZombieStrafing",1)
    Goto Missile	
Protection:
    TNT1 A 0 A_JumpIf(user_protection >= 3,"Pain")
	TNT1 A 0 A_JumpIf(user_protected == 1,"Pain")
	TNT1 A 0 A_PlaySound("legendary/defense")
	TNT1 A 0 A_FaceTarget
	CWGU E 2 Bright ACS_NamedExecuteAlways("LegendaryProtection",0,0,0,0)
	TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
	Goto See
    Death:
	    TNT1 A 0 A_Jump(36,"LegendarySoul")
	    TNT1 A 0 A_StopSound(6)
		TNT1 A 0 ACS_ExecuteAlways(5433,0,17)
        CWGU H 5
        CWGU I 5 A_Scream
        CWGU J 5 A_Fall
		CWGU J 5 A_SpawnItem("BodyCrash",0,0,0,0)
        CWGU K 5
        CWGU L -1
        Stop
	LegendarySoul:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	CWGU H 5 A_Scream
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    CWGU I 5 A_Fall
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    CWGU J 5 A_SpawnItem("BodyCrash",0,0,0,0)
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    CWGU K 5 
	TNT1 A 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
    CWGU L 140
	CWGU L 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	CWGU LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	CWGU LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	CWGU LLLLLLLLLLLLLLLLL 2 Bright A_GiveInventory("LegSoulEvent",1)
	TNT1 A 0 A_SpawnItemEx("CorruptedSoul",0,0,16,0,0,0,0,32)
	TNT1 A 0 A_SpawnItemEx("TeleportFog",0,0,16,0,0,0,0,32)
	CWGU L -1
	Stop
	
    XDeath:
	    TNT1 A 0 A_StopSound(6)
		TNT1 A 0 ACS_ExecuteAlways(5433,0,17)
        CWGU M 5 A_SpawnItemEx("BlueGibbedGenerator",0,0,0,0,0,0,0,128,0)
        CWGU N 5 A_XScream
        CWGU O 5 A_Fall
        CWGU PQRST 5
        CWGU U -1
        Stop
    }
}

Actor INFCorruptedCowboy: CorruptedCowboy 
{
Tag "\c[o7]Corrupted Cowboy\c-"
States
{
  Spawn:
    TNT1 A 0 A_Jump(100,"Remove")
	TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("CorruptedRuneSpawnCheck") == 2,1)
	Goto Remove
  Idle:
	TNT1 A 0 A_SpawnItem("CBoysFireSpawner")
	CWGU A 10 A_Look
	Loop
  Remove:
	TNT1 A 1
	TNT1 A 0 A_SpawnItemEx("zombieman",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION)
	TNT1 A 0 A_ChangeFlag("COUNTKILL", FALSE)
	TNT1 A 0
	Stop
	}
}

ACTOR CorruptedWESTZombieGhostA
{
Scale 1.1
Radius 20
Height 56
Speed 0
Alpha 0.7
PROJECTILE
RENDERSTYLE Translucent
+CLIENTSIDEONLY
States
{
Spawn:
    TNT1 A 0
    TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "Toaster")
Fade:
    TNT1 A 1
    CWGU A 2 A_FadeOut(0.10)
    Goto Fade+1
Toaster:
    TNT1 A 0
    Stop
    }
}

ACTOR CorruptedWESTZombieGhostB : CorruptedWESTZombieGhostA
{   
States
{
Spawn:
    TNT1 A 0
    TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "Toaster")
Fade:
    TNT1 A 1
    CWGU B 2 A_FadeOut(0.10)
    Goto Fade+1
Toaster:
    TNT1 A 0
    Stop
    }
}

ACTOR CorruptedWESTZombieGhostC : CorruptedWESTZombieGhostA
{   
States
{
Spawn:
    TNT1 A 0
    TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "Toaster")
Fade:
    TNT1 A 1
    CWGU C 2 A_FadeOut(0.10)
    Goto Fade+1
Toaster:
    TNT1 A 0
    Stop
    }
}

ACTOR CorruptedWESTZombieGhostD : CorruptedWESTZombieGhostA
{   
States
{
Spawn:
    TNT1 A 0
    TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "Toaster")
Fade:
    TNT1 A 1
    CWGU D 2 A_FadeOut(0.10)
    Goto Fade+1
Toaster:
    TNT1 A 0
    Stop
    }
}
