ACTOR AlphaEnragedLegendaryBarrelman : LegendaryBarrelMan
{
//Creator: Nemesiscaptain(uwu)and Makarov
//Origin: Infinity Gods
//Sprite: LB4R
//Title: "Alpha Enraged Legendary Barrelman"
  Monster
  Scale 1.2
  Health 1500
  Height 56
  Radius 20
  Speed 20
  PainChance 50
  BloodColor "Red"
  MinMissileChance 80
  +BRIGHT
  Species "Zombies"
DamageFactor 0.65
DamageFactor "LegendaryZombie", 0.0
DamageFactor "PDTBFG", 0.25
DamageFactor "PDTBFGTracer", 0.25
DamageFactor "PlayerDevBall", 0.125
DamageFactor "PlayerDevBall2", 0.125
DamageFactor "PlayerDTBFGRailgunSlug", 0.75
DamageFactor "PlayerDevTracer", 0.125
DamageFactor "DBFG10K2", 0.1
DamageFactor "PlayerDBFG10K2", 0.1
DamageFactor "DBFG2", 0.1
DamageFactor "PlayerDBFG2", 0.1
DamageFactor "Legendary", 0.0
DamageFactor "LegendaryPlayer", 0.0
DropItem "LegendaryBossLifeEssence" 256
DropItem "LegendaryBossArmorBonusMax" 256
DropItem "LegendaryBossLifeEssence" 128
DropItem "LegendaryBossArmorBonusMax" 128
DropItem "LegAmmoSphere" 93 1
DropItem "EnragedLegendaryArmor" 85
DropItem "HandGrenadeAmmo" 235 2
DropItem "MineAmmo" 240 2
DropItem "Backpack" 200 1
DropItem "Armorplate" 210 1
DropItem "Portablemedkit" 215 1
DropItem "StimKit" 220 3
DropItem "HealthFlask" 225 5
DropItem "LegendaryRune" 70 1
DropItem "LegendaryPowerShard" 110 1
DropItem "EnragedLegendaryPowerShard" 15 1
  DropItem "Autofuck" 10 1
  SeeSound ""
  PainSound ""
  DeathSound ""
  ActiveSound ""
  Obituary "%o was burned, broken, and barrelled by the  Alpha Enraged Legendary Barrel Man"
  Tag "\c[m6]Alpha\c- \c[z3]Enraged Legendary Barrelman\c-"
  var int user_protection;
  var int user_protected;
  var int user_attackmode;
  var int user_music;
  var int user_TurretUse;
  var int user_SniperLoop;
  var int user_SniperLoopStart;
  var int user_SniperAttack;
  States 
  {
  Spawn:
    AELB A 8 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
    TNT1 A 0 A_Look
	TNT1 A 0 A_JumpIfInTargetLOS("Seen",130)
    AELB B 8 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
    TNT1 A 0 A_Look
	TNT1 A 0 A_JumpIfInTargetLOS("Seen",130)
	Loop
  Stalking:
	TNT1 A 0 A_SpawnItemEx("EnragedHellionSmokeSpawner")
    TNT1 A 0 A_JumpIfInTargetLOS("Seen",130)
	AELB AA 3 A_Chase("","")
	TNT1 A 0 A_SpawnItemEx("EnragedHellionSmokeSpawner")
    TNT1 A 0 A_JumpIfInTargetLOS("Seen",130)
	AELB BB 3 A_Chase("","")
	TNT1 A 0 A_SpawnItemEx("EnragedHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItem("LegendaryFootStep",0,0,0,0)
    TNT1 A 0 A_JumpIfInTargetLOS("Seen",130)
	AELB CC 3 A_Chase("","")
	TNT1 A 0 A_SpawnItemEx("EnragedHellionSmokeSpawner")
    TNT1 A 0 A_JumpIfInTargetLOS("Seen",130)
	AELB DD 3 A_Chase("","")
	TNT1 A 0 A_SpawnItem("LegendaryFootStep",0,0,0,0)
	Loop
  Seen:
    EB4R AB 8 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_JumpIfInTargetLOS("Seen",130)
	Goto Stalking
  Idle:
	TNT1 A 0 A_ChangeFlag(NOPAIN,0)
	TNT1 A 0 A_SpawnItemEx("EnragedHellionSmokeSpawner")
	AELB A 10 A_Look
	Loop
  See:
    TNT1 A 0
    TNT1 A 0 A_JumpIf(user_attackmode == 1,1)
	TNT1 A 0 A_JumpIf(user_music == 1,3)
	TNT1 A 0 ACS_NamedExecuteAlways("InfinityMusic",0,1775,910)
	TNT1 A 0 A_SetUserVar("user_music",1)
	Goto Seen
	TNT1 A 0 A_ChangeFlag(NOPAIN,0)
	TNT1 A 0 A_UnHideThing
	TNT1 A 0 A_SetShootable
    TNT1 A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItemEx("EnragedHellionSmokeSpawner")
	AELB AA 3 A_Chase
	TNT1 A 0 A_SpawnItemEx("EnragedHellionSmokeSpawner")
	AELB BB 3 A_Chase
	TNT1 A 0 A_SpawnItemEx("EnragedHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItem("LegendaryFootStep",0,0,0,0)
    TNT1 A 0 A_JumpIfTargetInLOS("Strafing")
	AELB CC 3 A_Chase
	TNT1 A 0 A_Jump(80,"Phase")
	AELB A 0 A_Jump(80,"Rush")
	TNT1 A 0 A_SpawnItemEx("EnragedHellionSmokeSpawner")
	AELB DD 3 A_Chase
	TNT1 A 0 A_SpawnItem("LegendaryFootStep",0,0,0,0)
	Loop
  Rush:
    AELB A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItem("LegendaryFootStep")
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("AlphaEnragedLegendaryBarrelmanGhostA")
	AELB A 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("AlphaEnragedLegendaryBarrelmanGhostA")
	AELB A 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("AlphaEnragedLegendaryBarrelmanGhostB")
	AELB B 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("AlphaEnragedLegendaryBarrelmanGhostB")
	AELB B 1 A_Chase
	TNT1 A 0 A_Jump(80,"Phase")
	TNT1 A 0 A_SpawnItem("LegendaryFootStep")
    TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("AlphaEnragedLegendaryBarrelmanGhostC")
	AELB C 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("AlphaEnragedLegendaryBarrelmanGhostC")
	AELB C 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("AlphaEnragedLegendaryBarrelmanGhostD")
	AELB D 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("AlphaEnragedLegendaryBarrelmanGhostD")
	AELB D 1 A_Chase
	TNT1 A 0 A_SpawnItem("LegendaryFootStep")
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	TNT1 A 0 A_Jump(84,"See")
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	Loop
  Phase:
	TNT1 A 0 A_PlaySound("phaseimp/teleport")
	AELB E 2 A_FaceTarget
	AELB E 1 A_SetTranslucent(0.75)
	AELB E 1 A_SetTranslucent(0.55)
	AELB E 1 A_SetTranslucent(0.35)
	AELB E 1 A_SetTranslucent(0.20)
	Goto Phased
  UnPhase:
	TNT1 A 0 A_PlaySound("phaseimp/teleport")
	AELB E 1 A_SetTranslucent(0.15)
	AELB E 1 A_SetTranslucent(0.35)
	AELB E 1 A_SetTranslucent(0.55)
	AELB E 1 A_SetTranslucent(0.75)
	TNT1 A 0 A_SetTranslucent(1)
	AELB E 2 A_FaceTarget
    Goto See	
  Strafing:
	TNT1 A 0 A_SpawnItem("LegendaryFootStep",0,0,0,0)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	AELB AA 3 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	AELB BB 3 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 A 0 A_SpawnItem("LegendaryFootStep",0,0,0,0)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
    AELB CC 3 A_GiveInventory("LegZombieStrafingg",1)	
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	AELB DD 3 A_GiveInventory("LegZombieStrafingg",1)
	Goto See
  Phased:
	AELB AABBCCDDAABBCCDDAABBCCDDAABBCCDD 1 A_ExtChase(0,0)
	AELB AABBCCDDAABBCCDD 1 A_Chase
	TNT1 A 0 A_Jump(24,"UnPhase")
	Goto Phased+32	
  Missile:
	AELB EEEEEEEE 1 A_FaceTarget(45)
  MissileLoop:
    TNT1 A 0 A_SetUserVar(user_SniperLoop,0)
	TNT1 A 0 A_SetUserVar(user_SniperAttack,0)
    AELB E 10 A_FaceTarget 
	TNT1 A 0 A_JumpIfInventory("ELegAK47Ammo",92,"Reload")
	TNT1 A 0 A_GiveInventory("ELegAK47Ammo",1)
	TNT1 A 0 A_PlaySoundEx("weapons/LMGFire","Weapon")
	TNT1 A 0 A_GiveInventory("LegZombieStrafingg",1)	
	TNT1 A 0 A_CustomMissile("LegendaryRedTracer",Random(28,34),0,Random(6,-6),0)
	TNT1 A 0 A_SpawnItemEx("ELegRifleCasing",12,-6,36,Random(2,6),0,Random(1,3),Random(-80,-90),128)
	TNT1 A 0 A_CustomBulletAttack(32.1,12,1,Random(16,30)*3,"EnragedBulletPuff")
	AELB F 2 A_PlaySoundEx("weapons/LMGFire","Weapon")
	AELB F 3 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 A 0 A_CPosRefire
	TNT1 A 0 A_Jump(12,"Turrets")
	TNT1 A 0 A_Jump(25,"Nade","LegNade")
	TNT1 A 0 A_Jump(10,"Pause")
	TNT1 A 0 A_MonsterRefire(0,"See")
	Loop
  Pause:
	AELB EEEEE 8 Bright A_GiveInventory("LegZombieStrafingg",1)
	Goto See
  Turrets:
    TNT1 A 0 A_JumpIf(user_TurretUse == 1,"Sniper")
	AELB C 8 A_SpawnItem("EnragedHellionSmokeSpawner")
	AELB E 3 A_CustomMissile("ELTurretSpawner",32,0,25,0,15)
	AELB C 3 A_CustomMissile("ELTurretSpawner",32,0,-25,0,15)
	AELB E 3 A_CustomMissile("ELTurretSpawner",32,0,0,0,15)
	AELB EEE 8 A_SpawnItem("EnragedHellionSmokeSpawner")
	TNT1 A 0 A_SetUserVar(user_TurretUse,1)
	Goto See
  Sniper:
	TNT1 A 0 A_PlaySound("superzombie/sight")
	TNT1 A 0 A_GiveInventory("LegZombieStrafingg",1)	
	AELB E 5 A_FaceTarget
	TNT1 A 0 A_GiveInventory("LegZombieStrafingg",1)	
	AELB E 5 A_FaceTarget
  SniperLoopStart:
	TNT1 A 0 A_JumpIf(user_SniperLoopStart == 35,"SniperLoop")	
	AELB E 1 A_CustomRailgun(-1,7,NONE,NONE,RGF_SILENT|RGF_NOPIERCING,1,0,RailTargetPuff,0,0,0,0,2,0,"EnragedLaserSight")
	TNT1 A 0 A_SetUserVar(user_SniperLoopStart,user_SniperLoopStart+1)
	Loop
  SniperLoop:
	TNT1 A 0 A_JumpIf(user_SniperLoop == 100, "See")
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_JumpifTargetinLOS("SniperAttack")
	AELB E 1 A_CustomRailgun(-1,7,NONE,NONE,RGF_SILENT|RGF_NOPIERCING,1,0,RailTargetPuff,0,0,0,0,2,0,"EnragedLaserSight")
	TNT1 A 0 A_SetUserVar(user_SniperLoop,user_SniperLoop+1)
	Loop
  SniperAttack:
	TNT1 A 0 A_SetUserVar(user_SniperLoopStart,0)
	TNT1 A 0 A_JumpIf(user_SniperAttack == 8, "See")
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_CustomMissile("LegendaryRedTracer",Random(28,34),0,Random(2,-2),0)
	TNT1 A 0 A_PlaySoundEx("weapons/LMGFire","Weapon")
	TNT1 A 0 A_JumpIfInventory ("ELegAK47Ammo", 92, "Reload")
	TNT1 A 0 A_CustomRailgun(-1,7,NONE,NONE,RGF_SILENT|RGF_NOPIERCING,1,0,RailTargetPuff,0,0,0,0,2,0,"EnragedLaserSight")
	TNT1 A 0 A_GiveInventory ("ELegAK47Ammo", 1)
	TNT1 A 0 A_SpawnItemEx("ELegRifleCasing", 12, -6, 36, Random(2, 6), 0, Random(1, 3), Random(-80, -90), 128)
	TNT1 A 0 A_CustomBulletAttack(6,10,1,Random(10,20)*5,"EnragedBulletPuff",0,CBAF_NORANDOM)
	AELB FF 1
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	AELB EE 1 A_CustomRailgun(-1,7,NONE,NONE,RGF_SILENT|RGF_NOPIERCING,1,0,RailTargetPuff,0,0,0,0,2,0,"EnragedLaserSight")
	TNT1 A 0 A_SetUserVar(user_SniperAttack,user_SniperAttack+1)
	Loop
  Heal:
	TNT1 A 0 A_SpawnItem("GHellionSmokeSpawner")
	AELB A 5 
	TNT1 A 0 A_SpawnItem("GHellionSmokeSpawner")
	TNT1 A 0 HealThing(5)
	TNT1 A 0 A_PlaySound("pickups/flask",0,1.0,0)
	Goto Missile
  Nade:
	AELB E 1 A_JumpIfCloser(1000,1)
	Goto Missile
	TNT1 A 0 A_JumpIfCloser(280,"Missile")
	AELB E 6 A_GiveInventory("LegZombieStrafingg",1)
	AELB EEE 4 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafingg",1)
	AELB E 1 A_CustomMissile("ELACGrenade",32,0,0,2,4)
	AELB E 1
	Goto See
  LegNade:
	AELB E 1 A_JumpIfCloser(1000,1)
	Goto Missile
	TNT1 A 0 A_JumpIfCloser(280,"Missile")
	AELB E 12 A_GiveInventory("LegZombieStrafingg",1)
	AELB EEE 6 A_GiveInventory("LegZombieStrafingg",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafingg",1)
	AELB E 1 A_CustomMissile("ELACGrenade",32,0,0,2,4)
	AELB EE 25
	Goto See
  Reload:
    TNT1 A 0 A_ChangeFlag("NoPain", 1)
    TNT1 A 0 A_PlaySound("weapons/LMGReload2")
	TNT1 A 0 A_SpawnItemEx("LegendaryEmptyDrumSpawner", -8, 7, 30, 4, 0, (0.1)*Random(30, 40), Random(-80, -90), 128)
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
    AELB EE 25 A_TakeInventory ("ELegAK47Ammo", 92)
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
    AELB E 20 A_PlaySound("weapons/LMGReload1") 
	AELB E 40 A_PlaySound("weapons/LMGReload3")
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
    TNT1 A 0 A_ChangeFlag("NOPAIN",0)
    Goto See
  Pain:
    TNT1 A 0 A_JumpIf(user_attackmode == 1,4)
	TNT1 A 0 A_ChangeFlag(BOSS,1)
	TNT1 A 0 A_SetUserVar("user_attackmode",1)
	TNT1 A 0 A_ChangeFlag(NOPAIN,1)
	TNT1 A 0 A_Jump(15,"Protection")
	AELB G 3
	AELB G 3 A_Pain
	TNT1 A 0 A_Jump(128,"PainMissile")
	Goto See
  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
	AELB E 2 ACS_NamedExecuteAlways("EnragedLegendaryProtection",0,0,0,0)
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner",0,0,0,0)
	Goto See	
  PainMissile:
	TNT1 A 0
	TNT1 A 0 A_JumpIfTargetInLos("Missile",360,JLOSF_DEADNOJUMP|JLOSF_TARGETLOS)
	Goto See
  Death:
	TNT1 A 0
    //TNT1 A 0 A_Jump(36,"LegendarySoul") //its a Barrel, dont have Soul
	AELB H 1
	TNT1 A 0
	TNT1 A 1 A_StopSound
	TNT1 A 0 A_UnSetSolid
	TNT1 A 0 A_UnSetShootable
	TNT1 A 1 A_Explode(27368,3156)
	TNT1 A 1 A_ChangeFlag(FORCERADIUSDMG,1)
	TNT1 A 0 A_Explode(100,3156,0,0,3156)
	TNT1 A 0 A_CustomBulletAttack(0,0,1,10000,"LegSBomberAttack",3156)
	TNT1 A 0 Radius_Quake(7,105,0,140,0)
	TNT1 A 0 A_SpawnItemEx("RedParticleSpawner",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	TNT1 A 0 A_PlaySoundEx("enragedlegendary/strike","Voice",0,2)
	TNT1 A 10 A_SpawnItemEx("EnragedLegendaryBarrelStrike",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
	TNT1 A 0 A_SpawnItemEx("ELNukeHyperFlare",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
	TNT1 A 25 //A_SpawnItemEx("ELNukeHyperFloor",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
	TNT1 AA 0 A_SpawnItemEx("LNukeHyperSmokeFloor",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
	TNT1 A 0 A_SpawnItemEx("ELNukeHyperPillar",0,0,0,0,0,10,0,SXF_CLIENTSIDE,0)
	TNT1 A 105 A_SpawnItemEx("LNukeHyperSmokePillar",0,0,0,0,0,10,0,SXF_CLIENTSIDE,0)
	TNT1 A 0 A_SpawnItemEx("ELNukeHyperMushroom",0,0,1000,0,0,0,0,SXF_CLIENTSIDE,0)
	TNT1 AA 0 A_SpawnItemEx("LNukeHyperSmokeMushroom",0,0,1000,0,0,0,0,SXF_CLIENTSIDE,0)
	TNT1 AAAA 0 A_SpawnItemEx("Debris",0,0,0,Random(4,-4),Random(4,-4),Random(4,8),0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE,0)
	AELB I 5 A_Scream
	AELB K 5 A_NoBlocking
	AELB L 5
	AELB M 5
	AELB N -1
	Stop
	}
}

ACTOR AlphaEnragedLegendaryBarrelmanGhostA
{
States 
{
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "NULL")
  Fade:
	TNT1 A 1
	AELB A 2 A_FadeOut(0.10)
	Goto Fade+1
  Toaster:
	TNT1 A 0
	Stop
    }
}

ACTOR AlphaEnragedLegendaryBarrelmanGhostB : AlphaEnragedLegendaryBarrelmanGhostA
{   
States 
{
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "NULL")
  Fade:
	TNT1 A 1
	AELB B 2 A_FadeOut(0.10)
	Goto Fade+1
    }
}

ACTOR AlphaEnragedLegendaryBarrelmanGhostC : AlphaEnragedLegendaryBarrelmanGhostA
{   
States 
{
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "NULL")
  Fade:
	TNT1 A 1
	AELB C 2 A_FadeOut(0.10)
	Goto Fade+1
    }
}

ACTOR AlphaEnragedLegendaryBarrelmanGhostD : AlphaEnragedLegendaryBarrelmanGhostA
{   
States 
{
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "NULL")
  Fade:
	TNT1 A 1
	AELB D 2 A_FadeOut(0.10)
	Goto Fade+1
    }
}
	
Actor ELegBarrelManNade : ELACGrenade { Obituary "%o was caught by an AlphaEnragedLegendaryBarrelman's grenade." }
