ACTOR NemesisBarrelman
{
//Creator: Nemesiscaptain(uwu)and Makarov
//Origin: Infinity Gods
//Sprite: SNBM
//Title: "NemesisBarrelman"
  Monster
  Scale 1.2
  Health 1700
  Height 56
  Radius 20
  Speed 20
  PainChance 50
  BloodColor "Black"
  MinMissileChance 80
 +NOTIMEFREEZE
 +BOSS
 +BOSSDEATH
 +FLOORCLIP
 +MISSILEMORE
 +MISSILEEVENMORE
 +QUICKTORETALIATE
 +NOICEDEATH
 +NODROPOFF
 +DONTGIB
 +NOTARGET
 +NORADIUSDMG
 +FORCERADIUSDMG
 +NOFEAR
DamageFactor 0.6
DamageFactor "PDTBFG", 0.20
DamageFactor "PDTBFGTracer", 0.20
DamageFactor "PlayerDevBall", 0.120
DamageFactor "PlayerDevBall2", 0.120
DamageFactor "PlayerDTBFGRailgunSlug", 0.120
DamageFactor "PlayerDevTracer", 0.120
DamageFactor "Legendary", 0.0
DamageFactor "LegendaryGuru", 0.0
DamageFactor "LegendaryPlayer", 0.3
DamageFactor "LegendaryGuruPlayer", 0.3
DamageFactor "LACGrenade", 0.0
DamageFactor "DBFG10K2", 0.65
DamageFactor "PlayerDBFG10K2", 0.65
DamageFactor "DBFG2", 0.65
DamageFactor "PlayerDBFG2", 0.65
DamageFactor "PlayerNemesisPlasma", 0.0
DamageFactor "Explosion", 0.2
DamageFactor "PlayerDTRG", 0.4
DamageFactor "DTRailgun", 0.4
DamageFactor "PDTPuff", 0.4
DamageFactor "RailG", 0.3
DamageFactor "PlayerPyro", 0.1
DamageFactor "VileFires", 0.0
DamageFactor "DarkDemoEx", 0.0
DropItem "NemesisHealthBonusMax", 256, 32
DropItem "NemesisArmorBonus32", 256
DropItem "NemesisHealthBonusMax", 256, 32
DropItem "NemesisArmorBonus32", 256
DropItem "StimKit", 222, 3
DropItem "HealthFlask", 227, 5
DropItem "Armorplate", 212, 1
DropItem "LegAmmoSphere", 95, 1
DropItem "Portablemedkit", 217, 1
DropItem "NemesisRuneSpawnerTier1", 70, 1
DropItem "VengefulNemesisArmor", 92, 1
DropItem "NemesisPowerShard", 35, 1
DropItem "HandGrenadeAmmo", 237, 2
DropItem "MineAmmo", 242, 2
DropItem "ModdedBackPack", 202, 1
DropItem "NemesisShell", 256
DropItem "NemesisShellBox", 130
DropItem "Nemesis Assault Shotgun", 128, 1
SeeSound ""
PainSound ""
DeathSound ""
ActiveSound ""
Obituary "%o was caught in the path of \c[v9]NemesisBarrelman\c-'s final charge."
Tag "\c[v9]NemesisBarrelman\c-"
var int user_music;
var int user_attackmode;
States 
  {
  Spawn:
    SNBM A 8 A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
    TNT1 A 0 A_Look
	TNT1 A 0 A_JumpIfInTargetLOS("Seen",130)
    SNBM B 8 A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
    TNT1 A 0 A_Look
	TNT1 A 0 A_JumpIfInTargetLOS("Seen",130)
	Loop
  Stalking:
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
    TNT1 A 0 A_JumpIfInTargetLOS("Seen",130)
	SNBM AA 3 A_Chase("","")
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
    TNT1 A 0 A_JumpIfInTargetLOS("Seen",130)
	SNBM BB 3 A_Chase("","")
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
    TNT1 A 0 A_JumpIfInTargetLOS("Seen",130)
	SNBM CC 3 A_Chase("","")
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
    TNT1 A 0 A_JumpIfInTargetLOS("Seen",130)
	SNBM DD 3 A_Chase("","")
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	Loop
  Seen:
    LB0R AABB 8 A_SpawnItem("NemesisHellionSmokeSpawner",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("NemesisHellionSmokeSpawner")
	SNBM 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,6757,750)
	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("NemesisHellionSmokeSpawner")
	SNBM AA 3 A_Chase
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	SNBM BB 3 A_Chase
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
    TNT1 A 0 A_JumpIfTargetInLOS("Strafing")
	SNBM CC 3 A_Chase
	TNT1 A 0 A_Jump(80,"Rush")
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	SNBM DD 3 A_Chase
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	Loop
  Rush:
    SNBM A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItem("FootStep")
	TNT1 A 0 A_SpawnItem("NemesisHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("SuicideNemesisBarrelmanGhostA")
	SNBM A 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("SuicideNemesisBarrelmanGhostA")
	SNBM A 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("SuicideNemesisBarrelmanGhostB")
	SNBM B 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("SuicideNemesisBarrelmanGhostB")
	SNBM B 1 A_Chase
	TNT1 A 0 A_SpawnItem("FootStep")
    TNT1 A 0 A_SpawnItem("NemesisHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("SuicideNemesisBarrelmanGhostC")
	SNBM C 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("SuicideNemesisBarrelmanGhostC")
	SNBM C 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("SuicideNemesisBarrelmanGhostD")
	SNBM D 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("SuicideNemesisBarrelmanGhostD")
	SNBM D 1 A_Chase
	TNT1 A 0 A_SpawnItem("FootStep")
	TNT1 A 0 A_SpawnItem("NemesisHellionSmokeSpawner")
	TNT1 A 0 A_Jump(84,"See")
	TNT1 A 0 A_SpawnItem("NemesisHellionSmokeSpawner")
	Loop
  Teleport:
	SNBM A 1 Bright A_UnSetShootable
	TNT1 AAAA 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	SNBM AAAAAAAAAA 1 Bright A_FadeOut(0.1,0)
	SNBM A 2 Bright
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_Wander
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_Wander
	SNBM A 1 Bright A_PlayWeaponSound("boss/teleport")
	TNT1 AAAA 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	SNBM AAAAAAAAAA 1 Bright A_FadeIn(0.1)
	SNBM A 1 Bright A_SetShootable
	Goto See
  Missile:
	TNT1 A 0 A_SetShootable
	TNT1 A 0 A_UnsetInvulnerable
	TNT1 A 0 A_SetTranslucent(1)
	SNBM E 3 A_GiveInventory("NemesisLegZombieStrafing",1)
  MissileLoop:
	TNT1 A 0 A_GiveInventory("NemesisLegZombieStrafing",1)
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	TNT1 A 0 A_JumpIfInventory("ASGZAmmo",16,"Reload")
	SNBM E 4 Bright A_FaceTarget
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	TNT1 A 0 A_GiveInventory("ASGZAmmo",1)
	TNT1 A 0 A_SpawnItemEx("NemesisShellCasing",-8,7,30,4,0,(0.1)*Random(30,40),Random(-80,-90),128)
	TNT1 A 0 A_PlaySound("NemesisASG/Fire",5)
	TNT1 AAAAAAA 0 A_CustomMissile("NemesisASGBall",32,0,0,CMF_OFFSETPITCH,0)
	SNBM E 4 Bright A_FaceTarget
	TNT1 A 0 A_CPosRefire
	TNT1 A 0 A_Jump(10,"Grenade")
	TNT1 A 0 A_Jump(20,"MidAttackTeleport")
	TNT1 A 0 A_JumpIfCloser(300,"MidAttackTeleport")
	Loop
  Strafing:
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	SNBM AA 3 Bright A_GiveInventory("NemesisLegZombieStrafing",1)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	SNBM BB 3 Bright A_GiveInventory("NemesisLegZombieStrafing",1)
	TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	SNBM CC 3 Bright A_GiveInventory("NemesisLegZombieStrafing",1)  
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	SNBM DD 3 Bright A_GiveInventory("NemesisLegZombieStrafing",1)
	Goto See
  Mine:
	SNBM C 1 Bright
	SNBM C 12 Bright A_CustomMissile("NemesisSpringMineSet",32,0,0,2,15)
	SNBM E 12 Bright
	SNBM C 3 Bright
	Goto See
  Grenade:
	TNT1 A 0 A_PlaySound("weapons/hgrenadepin",0,1.0,0)
	SNBM CE 4 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("weapons/hgrenadethrow",0,1.0,0)
	SNBM E 1 Bright A_CustomMissile("NemesisGrenade",32,0,0,2,4)
	Goto Dodge
  MidAttackTeleport:
	SNBM E 1 Bright A_UnSetShootable
	TNT1 AAAA 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	SNBM E 1 Bright A_FadeOut(0.1,0)
	TNT1 A 0 A_GiveInventory("NemesisLegZombieStrafing",1)
	SNBM EEE 1 Bright A_FadeOut(0.1,0)
	TNT1 A 0 A_GiveInventory("NemesisLegZombieStrafing",1)
	SNBM EEE 1 Bright A_FadeOut(0.1,0)
	TNT1 A 0 A_GiveInventory("NemesisLegZombieStrafing",1)
	SNBM EEE 1 Bright A_FadeOut(0.1,0)
	SNBM E 2 Bright
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_Wander
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_Wander
	SNBM E 1 Bright A_PlayWeaponSound("boss/teleport")
	TNT1 AAAA 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	SNBM EEEEEEEEEE 1 Bright A_FadeIn(0.1)
	SNBM EEE 1 Bright A_FadeIn(0.1)
	TNT1 A 0 A_GiveInventory("NemesisLegZombieStrafing",1)
	SNBM EEE 1 Bright A_FadeIn(0.1)
	TNT1 A 0 A_GiveInventory("NemesisLegZombieStrafing",1)
	SNBM EEE 1 Bright A_FadeIn(0.1)
	TNT1 A 0 A_GiveInventory("NemesisLegZombieStrafing",1)
	SNBM E 1 Bright A_FadeIn(0.1)
	SNBM E 1 Bright A_SetShootable
	Goto Grenade
  Reload:
	TNT1 A 0 A_ChangeFlag("NoPain",1)
	TNT1 A 0 A_PlaySound("lasgguy/asgout")
	TNT1 A 0 A_SpawnItemEx("LegendaryEmptyDrumSpawner",-8,7,30,4,0,(0.1)*Random(30,40),Random(-80,-90),128)
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	SNBM E 20 Bright A_TakeInventory("ASGZAmmo",16)
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	SNBM E 8 Bright A_PlaySound("lasgguy/asgin") 
	SNBM E 10 Bright A_PlaySound("LShotgun/Cock")
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	TNT1 A 0 A_ChangeFlag("NoPain",0)
	Goto See
  Pain:
	TNT1 A 0 A_Jump(30,"Teleport")
	TNT1 A 0 A_Jump(20,"Dodge")
	SNBM G 3 Bright
	SNBM G 3 Bright A_Pain
	TNT1 A 0 A_Jump(40,"Dodge")
	TNT1 A 0 A_Jump(192,"Missile")
	Goto See
  SeeNoDodge:
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	SNBM AABB 2 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("FootStep",0,0,2,0,0,-20)
	SNBM CCDD 2 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("FootStep",0,0,2,0,0,-20)
	SNBM AABB 2 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("FootStep",0,0,2,0,0,-20)
	SNBM CCDD 2 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("FootStep",0,0,2,0,0,-20)
	SNBM AABB 2 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("FootStep",0,0,2,0,0,-20)
	SNBM CCDD 2 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("FootStep",0,0,2,0,0,-20)
	Goto Chase
  Dodge:
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	SNBM A 1 Bright A_FaceTarget
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	TNT1 A 0 ThrustThingZ(0, 20, 0, 0)
	TNT1 A 0 A_Jump(256, "DodgeRight", "DodgeLeft")
  DodgeLeft:
	TNT1 A 0 ThrustThing(angle*256/360+192, 15, 0, 0)
	Goto SeeNoDodge
  DodgeRight:
	TNT1 A 0 ThrustThing(angle*256/360+64, 15, 0, 0)
	Goto SeeNoDodge
  PainMissile:
	TNT1 A 0
	TNT1 A 0 A_JumpIfTargetInLos("Missile",360,JLOSF_DEADNOJUMP|JLOSF_TARGETLOS)
	Goto See
  Death:
	TNT1 A 0
	SNBM H 1
    TNT1 A 0 A_SpawnItem("SuperGayAttackBarrel")
  	TNT1 AAAAAAAAA 4
	SNBM I 5 A_Scream
	SNBM K 5 A_NoBlocking
	SNBM L 5
	SNBM M 5
	SNBM N -1
	Stop
	}
}

ACTOR SuicideNemesisBarrelmanGhostA
{
PROJECTILE
Height 56
Radius 20
Speed 0
Scale 1.1
RENDERSTYLE Translucent
Alpha 0.7
+NOTIMEFREEZE
+NOINTERACTION
+CLIENTSIDEONLY
States
  {
  Spawn:
	TNT1 A 0
	TNT1 A 1 A_JumpIf(ACS_ExecuteWithResult(304) == 1,"NULL")
	Goto Fade
  Fade:
	SNBM A 2 A_FadeOut(0.1,1)
	Loop
  Toaster:
	TNT1 A 1
	Stop
  }
}

ACTOR SuicideNemesisBarrelmanGhostB : SuicideNemesisBarrelmanGhostA
{

States
  {
  Spawn:
	TNT1 A 0
	TNT1 A 1 A_JumpIf(ACS_ExecuteWithResult(304) == 1,"NULL")
	Goto Fade
  Fade:
	SNBM B 2 A_FadeOut(0.1,1)
	Loop
  Toaster:
	TNT1 A 1
	Stop
  }
}

ACTOR SuicideNemesisBarrelmanGhostC : SuicideNemesisBarrelmanGhostA
{

States
  {
  Spawn:
	TNT1 A 0
	TNT1 A 1 A_JumpIf(ACS_ExecuteWithResult(304) == 1,"NULL")
	Goto Fade
  Fade:
	SNBM C 2 A_FadeOut(0.1,1)
	Loop
  Toaster:
	TNT1 A 1
	Stop
  }
}

ACTOR SuicideNemesisBarrelmanGhostD : SuicideNemesisBarrelmanGhostA
{

States
  {
  Spawn:
	TNT1 A 0
	TNT1 A 1 A_JumpIf(ACS_ExecuteWithResult(304) == 1,"NULL")
	Goto Fade
  Fade:
	SNBM D 2 A_FadeOut(0.1,1)
	Loop
  Toaster:
	TNT1 A 1
	Stop
  }
}
