Actor DoubleChaingunner : DnD_BaseRangedMonster {
	Obituary "%o was ripped to bloody ribbons by a double-chaingunner."
	Health 0x7FFFFFFF
	GibHealth -25
	Radius 20
	Height 56
	Mass 512
	Speed 8
	PainChance 150
	SeeSound "chainguy/sight"
	AttackSound "weapons/minigunfire"
	PainSound "chainguy/pain"
	DeathSound "chainguy/death"
	ActiveSound "chainguy/active"
	DropItem "MachinegunPickup_Drop"
	DropItem "MachinegunPickup_Drop"
	Tag "Double Chaingunner"
	+ISMONSTER
	States {
		SetInfo:
			TNT1 A 0 A_SetArg(4, DND_DOUBLEGUNNER)
			TNT1 A 0 ACS_NamedExecuteWithResult("DnD Init Monster Data", DND_MWEIGHT_EPIC)
		Goto SpawnSetup
	
		IdleState:
			DPOS AB 10 A_GiveInventory("DnD_SightChecker", 1)
		Loop
		SeeState:
			DPOS AABBCCDD 3 Fast A_Chase
		Goto See
		MissileState:
			DPOS E 10 Fast A_FaceTarget
			TNT1 A 0 A_PlaySound("weapons/minigunfire", CHAN_WEAPON)
			TNT1 A 0 A_SpawnItemEx ("bulletcasing", -8, 7, 26, 4, 0, frandom(3.0, 5.0), random(-80, -90))
			TNT1 A 0 A_SpawnItemEx ("bulletcasing", -8, 32, 26, -4, 0, frandom(3.0, 5.0), random(-130, -110))
			TNT1 A 0 A_CustomMissile("ZombieBullet", 32, 7, frandom(-22.5, 22.5))
			DPOS F 4 Fast Bright A_CustomMissile("ZombieBullet", 32, 32, frandom(-22.5, 22.5))
			TNT1 A 0 A_PlaySound("weapons/minigunfire", CHAN_WEAPON)
			TNT1 A 0 A_SpawnItemEx ("bulletcasing", -8, 7, 26, 4, 0, frandom(3.0, 5.0), random(-80, -90))
			TNT1 A 0 A_SpawnItemEx ("bulletcasing", -8, 32, 26, -4, 0, frandom(3.0, 5.0), random(-130, -110))
			TNT1 A 0 A_CustomMissile("ZombieBullet", 32, 7, frandom(-22.5, 22.5))
			TNT1 A 0 ACS_NamedExecuteAlways("DnD On Monster Attack", 0)
			DPOS E 4 Fast Bright A_CustomMissile("ZombieBullet", 32, 32, frandom(-22.5, 22.5))
			DPOS F 1 A_CPosRefire
		Goto MissileState + 1
		PainState:
			DPOS G 3 Fast
			DPOS G 3 Fast A_Pain
		Goto See
		DeathState:
			DPOS H 5
			DPOS I 5 A_Scream
			DPOS J 5 A_NoBlocking
			DPOS KLM 5
			DPOS N -1
		Stop
		XDeathState:
			TNT1 A 0 A_SpawnDebris("NashGore_Gib9",0)
			TNT1 A 0 A_SpawnDebris("NashGore_Gib10",0)
			TNT1 A 0 A_SpawnDebris("NashGore_Gib11",0)
			TNT1 A 0 A_SpawnDebris("NashGore_Gib11",0)
			TNT1 A 0 A_SpawnItemEx("GenericGibber_Low_Delayed", 0, 0, 0, 0, 0, 0, 0, SXF_USEBLOODCOLOR)
			DPOS O 5
			DPOS P 5 A_XScream
			DPOS Q 5 A_NoBlocking
			DPOS RS 5
			DPOS T -1
		Stop
		RaiseState:
			DPOS NMLKJIH 5
		Goto See
	}
}

Actor MajorBullet : ZombieBullet {
	Damage (random(1, 5) * 4)
}

Actor ChaingunMajor : DnD_BaseRangedMonster {
	Health 0x7FFFFFFF
	GibHealth -25
	Painchance 96
	Mass 512
	Obituary "%o was perforated by the chaingun major."
	AttackSound "weapons/minigunfire"
	SeeSound "ChaingunMajor/See"
	PainSound "ChaingunMajor/Pain"
	DeathSound "ChaingunMajor/Die"
	Decal Bulletchip
	DropItem "MachinegunPickup_Drop"
	Tag "Chaingun Major"
	Radius 20
	Height 56
	Speed 8
	ActiveSound "chainguy/active"
	+ISMONSTER
	States {
		SetInfo:
			TNT1 A 0 A_SetArg(4, DND_CGMAJOR)
			TNT1 A 0 ACS_NamedExecuteWithResult("DnD Init Monster Data", DND_MWEIGHT_UNCOMMON)
		Goto SpawnSetup

		IdleState:
			CPS2 AB 10 A_GiveInventory("DnD_SightChecker", 1)
		Loop
		SeeState:
			CPS2 AABBCCDD 3 Fast A_Chase
		Goto See
		MissileState:
			CPS2 E 10 Fast A_FaceTarget
			TNT1 A 0 A_SpawnItemEx ("bulletcasing", -8, 7, 26, 4, 0, frandom(3.0, 5.0), random(-80, -90))
			TNT1 A 0 A_PlaySound("weapons/minigunfire", CHAN_WEAPON)
			CPS2 F 3 Fast A_CustomMissile("MajorBullet", 32, 8, frandom(-22.5, 22.5))
			TNT1 A 0 A_SpawnItemEx ("bulletcasing", -8, 7, 26, 4, 0, frandom(3.0, 5.0), random(-80, -90))
			TNT1 A 0 A_PlaySound("weapons/minigunfire", CHAN_WEAPON)
			TNT1 A 0 ACS_NamedExecuteAlways("DnD On Monster Attack", 0)
			CPS2 E 3 Fast A_CustomMissile("MajorBullet", 32, 8, frandom(-22.5, 22.5))
			CPS2 F 1 A_CPosRefire
		Goto MissileState + 1
		PainState:
			CPS2 G 3 Fast
			CPS2 G 3 Fast A_Pain
		Goto See
		DeathState:
			CPS2 H 5
			CPS2 I 5 A_Scream
			CPS2 J 5 A_Fall
			CPS2 KLMNO 5
			CPS2 P -1
		Stop
		XDeathState:
			TNT1 A 0 A_SpawnDebris("NashGore_Gib9",0)
			TNT1 A 0 A_SpawnDebris("NashGore_Gib10",0)
			TNT1 A 0 A_SpawnDebris("NashGore_Gib11",0)
			TNT1 A 0 A_SpawnDebris("NashGore_Gib11",0)
			TNT1 A 0 A_SpawnItemEx("GenericGibber_Low_Delayed", 0, 0, 0, 0, 0, 0, 0, SXF_USEBLOODCOLOR)
			CPS2 Q 5
			CPS2 R 5 A_XScream
			CPS2 S 5 A_Fall
			CPS2 TUVW 5
			CPS2 X -1
		Stop
		RaiseState:
			CPS2 ONMLKJIH 5
		Goto See
	}
}

actor ZSec : DnD_BaseRangedMonster {
	obituary "%o was gunned down by a possessed zsec guard!"
	Health 0x7FFFFFFF
	GibHealth -25
	radius 20
	height 56
	mass 224
	speed 8
	painchance 128
	decal bulletchip
	seesound "zsec/sight"
	attacksound "zsec/attack"
	painsound "zsec/pain"
	deathsound "zsec/death"
	activesound "zsec/active"
	DropItem "MachinegunPickup_Drop"
	Tag "ZSec"
	+ISMONSTER
	+MISSILEMORE
	+DONTHURTSPECIES
	states {
		SetInfo:
			TNT1 A 0 A_SetArg(4, DND_ZSEC)
			TNT1 A 0 ACS_NamedExecuteWithResult("DnD Init Monster Data", DND_MWEIGHT_RARE1)
		Goto SpawnSetup

		IdleState:
			ZSEC E 1 A_GiveInventory("DnD_SightChecker", 1)
		loop
		SeeState:
			ZSEC A 0 A_TakeInventory("ZSecCharge", 1)
			ZSEC A 0 A_GiveInventory("ZSecCharge", 1)
			ZSEC A 0 A_CheckSight(14)
			ZSEC A 0 A_JumpIfHealthLower(50, 10)
			ZSEC A 0 A_JumpIfInventory("ZSecCharge", 1, 13)
		SeeStateMove:
			ZSEC AABBCCDD 4 Fast A_Chase
		Goto See
			ZSEC A 0 A_Jump(32, 1)
			ZSEC A 0 A_ChangeFlag("Frightened", 1)
			ZSEC A 0
		Goto SeeState + 4
			ZSEC A 0 A_TakeInventory("ZSecCharge", 1)
		Goto SeeState + 3
			ZSEC A 0 A_Jump(128, 1)
		Goto SeeState + 5
			ZSEC AAABBBCCCDDD 2 Fast A_Chase
		Goto See
		MissileState:
			ZSEC E 0 A_ChangeFlag("NoPain", 1)
			ZSEC E 0 A_Jump(64, 19)
			ZSEC E 10 Fast A_FaceTarget
			ZSEC E 0 A_JumpIfInventory("ZSecAmmo", 10, 13)
			TNT1 A 0 A_SpawnItemEx ("bulletcasing", -8, 7, 24, 4, 0, frandom(3.0, 5.0), random(-80, -90))
			TNT1 A 0 A_PlaySound("zsec/attack", CHAN_WEAPON)
			ZSEC F 2 Fast bright A_CustomMissile("SMGZombieBullet", 32, 0, frandom(-5.0, 5.0), 0, frandom(-5.0, 5.0))
			ZSEC E 2 Fast A_FaceTarget
			TNT1 A 0 A_SpawnItemEx ("bulletcasing", -8, 7, 24, 4, 0, frandom(3.0, 5.0), random(-80, -90))
			TNT1 A 0 A_PlaySound("zsec/attack", CHAN_WEAPON)
			ZSEC F 2 Fast bright A_CustomMissile("SMGZombieBullet", 32, 0, frandom(-5.0, 5.0), 0, frandom(-5.0, 5.0))
			ZSEC E 2 Fast A_FaceTarget
			TNT1 A 0 ACS_NamedExecuteAlways("DnD On Monster Attack", 0)
			TNT1 A 0 A_SpawnItemEx ("bulletcasing", -8, 7, 24, 4, 0, frandom(3.0, 5.0), random(-80, -90))
			TNT1 A 0 A_PlaySound("zsec/attack", CHAN_WEAPON)
			ZSEC F 2 Fast bright A_CustomMissile("SMGZombieBullet", 32, 0, frandom(-5.0, 5.0), 0, frandom(-5.0, 5.0))
			ZSEC E 2 Fast A_FaceTarget
			TNT1 A 0 A_SpawnItemEx ("bulletcasing", -8, 7, 24, 4, 0, frandom(3.0, 5.0), random(-80, -90))
			TNT1 A 0 A_PlaySound("zsec/attack", CHAN_WEAPON)
			ZSEC F 2 Fast bright A_CustomMissile("SMGZombieBullet", 32, 0, frandom(-5.0, 5.0), 0, frandom(-5.0, 5.0))
			ZSEC E 2 Fast A_FaceTarget
			ZSEC E 0 A_GiveInventory("ZSecAmmo", 1)
			ZSEC E 0 A_Jump(32, 2)
			ZSEC E 0 A_SpidReFire
		Goto MissileState + 3
			ZSEC E 0
		goto See
			ZSEC E 0 A_TakeInventory("ZSecAmmo", 10)
			ZSEC E 8 Fast A_PlaySound("ZSec/DryFire")
			ZSEC E 55 Fast A_PlaySound("ZSec/Reload")
			ZSEC E 0 A_ChangeFlag("NoPain", 0)
		goto See
			ZSEC E 0 A_JumpIfCloser(384, 1)
		Goto MissileState + 2
			ZSEC E 8 Fast A_FaceTarget
			ZSEC F 0 bright A_PlaySound("weapons/rocklf")
			ZSEC F 2 Fast bright A_CustomMissile("ZSecGrenade", 28, 5, 0)
			ZSEC E 6 Fast A_FaceTarget
			ZSEC E 0 A_ChangeFlag("NoPain", 0)
		Goto See
		PainState:
			ZSEC G 3 Fast
			ZSEC G 3 Fast A_Pain
		goto See
		DeathState:
			ZSDI A 5
			ZSDI B 5 A_Scream
			ZSDI C 5 A_NoBlocking
			ZSDI D 5
			ZSDI E -1
		stop
		XDeathState:
			TNT1 A 0 A_SpawnDebris("NashGore_Gib9",0)
			TNT1 A 0 A_SpawnDebris("NashGore_Gib10",0)
			TNT1 A 0 A_SpawnDebris("NashGore_Gib11",0)
			TNT1 A 0 A_SpawnDebris("NashGore_Gib11",0)
			TNT1 A 0 A_SpawnItemEx("GenericGibber_Low_Delayed", 0, 0, 0, 0, 0, 0, 0, SXF_USEBLOODCOLOR)
			SPOS M 5
			SPOS N 5 A_XScream
			SPOS O 5 A_NoBlocking
			SPOS PQRST 5
			SPOS U -1
		stop
		RaiseState:
			ZSDI DCBA 5
		goto See
	}
}

actor ZSecAmmo : inventory {
	Inventory.MaxAmount 10
}

actor ZSecCharge : inventory {
	Inventory.MaxAmount 1
}

Actor ZSecGrenade {
	obituary "%o ate a ZSec's grenade."
	radius 6
	height 8
	speed 20
	damage (10)
	DamageType "Explosive"
	Stamina 4
	seesound "ZSec/bounce"
	PROJECTILE
	+DONTBLAST
	+DOOMBOUNCE
	-NOGRAVITY
	+GRENADETRAIL
	+DONTFALL
	bouncefactor 0.5
	bouncecount 10
	states {
		Spawn:
			TNT1 A 0 NoDelay ACS_NamedExecuteAlways("DnD Pierce Check")
			GRND AAA 35 bright
		Death:
			MISL C 0 bright A_PlaySound("weapons/rocklx")
			MISL C 0 bright A_ChangeFlag(NoGravity, 1)
			MISL C 5 bright A_Explode(25,128,1)
			MISL D 4 bright
			MISL E 3 bright
		stop
	}
}

Actor ZSpecOpsMachinegun : DnD_BaseRangedMonster {
	Health 0x7FFFFFFF
	GibHealth -25
	Height 56
	Radius 20
	Speed 8
	PainChance 192
	Mass 160
	+NoTarget
	+NoInfighting
	SeeSound "ZSpecOps/Sight"
	ActiveSound "ZSpecOps/Sight"
	PainSound "ZSpecOps/Pain"
	DeathSound "ZSpecOps/Death"
	Obituary "%o was gunned down by a ZSpecOps"
	Decal BulletChip
	DropItem "MachinegunPickup_Drop"
	Tag "ZSpec MG"
	+ISMONSTER
	States {
		SetInfo:
			TNT1 A 0 A_SetArg(4, DND_ZSPECMG)
			TNT1 A 0 ACS_NamedExecuteWithResult("DnD Init Monster Data", DND_MWEIGHT_RARE2)
		Goto SpawnSetup
	
		IdleState:
			ZSP2 AAAAAAAAAABBBBBBBBBB 1 A_GiveInventory("DnD_SightChecker", 1)
		Loop
		SeeState:
			ZSP2 ABCD 3 A_Chase
		Goto See
		MissileState:
			ZSP2 EEE 4 Fast A_FaceTarget
			ZSP2 F 0 Bright A_PlayWeaponSound("ZSpecOps/MGun")
			TNT1 A 0 A_SpawnItemEx ("bulletcasing", -8, 7, 24, 4, 0, frandom(3.0, 5.0), random(-80, -90))
			ZSP2 F 2 Fast Bright A_CustomMissile("UndeadInitiateBullet", 32, 8, frandom(-11.0, 11.0), 0, frandom(-8.0, 8.0))
			ZSP2 E 2 Fast A_FaceTarget
			ZSP2 F 0 Bright A_PlayWeaponSound("ZSpecOps/MGun")
			TNT1 A 0 A_SpawnItemEx ("bulletcasing", -8, 7, 24, 4, 0, frandom(3.0, 5.0), random(-80, -90))
			ZSP2 F 2 Fast Bright A_CustomMissile("UndeadInitiateBullet", 32, 8, frandom(-11.0, 11.0), 0, frandom(-8.0, 8.0))
			ZSP2 E 2 Fast A_FaceTarget
			TNT1 A 0 ACS_NamedExecuteAlways("DnD On Monster Attack", 0)
			ZSP2 F 0 Bright A_PlayWeaponSound("ZSpecOps/MGun")
			TNT1 A 0 A_SpawnItemEx ("bulletcasing", -8, 7, 24, 4, 0, frandom(3.0, 5.0), random(-80, -90))
			ZSP2 F 2 Fast Bright A_CustomMissile("UndeadInitiateBullet", 32, 8, frandom(-11.0, 11.0), 0, frandom(-8.0, 8.0))
			ZSP2 E 2 Fast A_FaceTarget
			ZSP2 F 0 A_MonsterRefire(40, "See")
		Goto MissileState + 3
		PainState:
			ZSP2 G 4 Fast
			ZSP2 G 4 Fast A_Pain
		Goto See
		DeathState:
			ZSP2 H 5
			ZSP2 I 5 A_Scream
			ZSP2 J 5
			ZSP2 K 5 A_NoBlocking
			ZSP2 L -1
		Stop
		XDeathState:
			TNT1 A 0 A_SpawnDebris("NashGore_Gib9",0)
			TNT1 A 0 A_SpawnDebris("NashGore_Gib10",0)
			TNT1 A 0 A_SpawnDebris("NashGore_Gib11",0)
			TNT1 A 0 A_SpawnDebris("NashGore_Gib11",0)
			TNT1 A 0 A_SpawnItemEx("GenericGibber_Low_Delayed", 0, 0, 0, 0, 0, 0, 0, SXF_USEBLOODCOLOR)
			ZS21 G 2 A_XScream
			ZSP2 G 1 A_NoBlocking
			TNT1 A 5 A_SpawnItemEx("GenericGibber_Low", 0, 0, 0, 0, 0, 0, 0, SXF_USEBLOODCOLOR)
		Stop
		RaiseState:
			ZSP2 KJIH 5
		Goto See
	}
}

Actor QuakeZombieChaingun : DnD_BaseRangedMonster {
	Translation "236:239=108:111", "128:143=92:107"
    Health 0x7FFFFFFF
	GibHealth -25
    Radius 20
    Height 56
    Speed 8
    PainChance 160
    Obituary "%o was killed by an elite enforcer."
	DropItem "LaserPickup"
	Tag "Enforcer Sargeant"
    SeeSound "SSGUNER/sight"
    AttackSound "grunt/attack"
    PainSound "QuakeZombie/pain"
    DeathSound "QuakeZombie/die"
    ActiveSound "SSGUNER/idle"
	+ISMONSTER
    States {
		SetInfo:
			TNT1 A 0 A_SetArg(4, DND_ZOMBIEQUAKE3)
			TNT1 A 0 ACS_NamedExecuteWithResult("DnD Init Monster Data", DND_MWEIGHT_UNCOMMON)
		Goto SpawnSetup

		IdleState:
			QZOM AB 10 A_GiveInventory("DnD_SightChecker", 1)
		Loop
		SeeState:
			QZOM AABBCCDD 4 A_Chase
		Goto See
		MissileState:
			QZOM E 6 Fast A_FaceTarget
			TNT1 A 0 A_Jump(128, "Double")
			TNT1 A 0 A_Playsound("Enforcer/Fire")
			TNT1 A 0 ACS_NamedExecuteAlways("DnD On Monster Attack", 0)
			QZOM F 4 Fast Bright A_CustomMissile("EnforcerPlasma2", 32, 6)
			QZOM E 4 Fast
			QZOM E 1 A_CPosRefire
		Goto MissileState + 1
		Double:
			TNT1 A 0 A_Playsound("Enforcer/Fire")
			TNT1 A 0 ACS_NamedExecuteAlways("DnD On Monster Attack", 0)
			TNT1 A 0 A_CustomMissile("EnforcerPlasma2", 32, 6, -1)
			QZOM F 4 Fast Bright A_CustomMissile("EnforcerPlasma2", 32, 6, 1)
			QZOM E 4 Fast
			QZOM E 1 A_CPosRefire	
		Goto MissileState + 1
		PainState:
			QZOM G 3 Fast
			QZOM G 3 Fast A_Pain
		Goto See
		DeathState:
			QZOM H 5
			QZOM I 5 A_Scream
			QZOM J 5 A_Fall
			QZOM K 5
			QZOM L -1
		Stop
		XDeathState:
			TNT1 A 0 A_SpawnDebris("NashGore_Gib9",0)
			TNT1 A 0 A_SpawnDebris("NashGore_Gib10",0)
			TNT1 A 0 A_SpawnDebris("NashGore_Gib11",0)
			TNT1 A 0 A_SpawnDebris("NashGore_Gib11",0)
			TNT1 A 0 A_SpawnItemEx("GenericGibber_Low_Delayed", 0, 0, 0, 0, 0, 0, 0, SXF_USEBLOODCOLOR)
			QZOM M 5 
			QZOM N 5 A_XScream
			QZOM O 5 A_Fall
			QZOM PQR 5
			QZOM S -1
		Stop
		RaiseState:
			QZOM KJIH 5
		Goto See
    }
}

Actor EnforcerPlasma2 : EnforcerPlasma {
	Height 8
	Radius 4
	RenderStyle Add
	Damage (2 * random(3,6))
	Alpha 0.8
	Scale 0.25
	Speed 40
	DeathSound "Enforcer/Hit"
	+FOILINVUL
	States {
		Spawn:
			TNT1 A 0 NoDelay ACS_NamedExecuteAlways("DnD Pierce Check")
			TRAC A -1 Bright
		Stop
		Death:
			TNT1 AAAAAA 0 A_SpawnItemEx("EnforcerFX", random(-4,4), random(-4,4), random(-2, 2), 0, 0, 0)
			TNT1 A 2
		Stop
	}
}

actor UndeadInitiate : DnD_BaseHybridMonster {
	obituary "%o was bagged by an undead initiate."
	DropItem "BerettasPickup"
	Tag "Undead Initiate"
	Health 0x7FFFFFFF
	GibHealth -25
	gibhealth 10
	radius 20
	height 56
	mass 125
	speed 8
	painchance 30
	decal BulletChip
	SeeSound "UndeadInitiate/See"
	ActiveSound "UndeadInitiate/Act"
	painsound "UndeadInitiate/Pain"
	deathsound "UndeadInitiate/Death"
	+ISMONSTER
	+NODROPOFF
	states {
		SetInfo:
			TNT1 A 0 A_SetArg(4, DND_INITIATE)
			TNT1 A 0 ACS_NamedExecuteWithResult("DnD Init Monster Data", DND_MWEIGHT_VERYRARE)
		Goto SpawnSetup

		IdleState:
			1102 A 10 A_GiveInventory("DnD_SightChecker", 1)
		loop
		SeeState:
			1102 A 0 A_Jump (32, "Run")
			1102 AA 3 Fast A_Chase
			1102 BB 3 Fast A_FastChase
			1102 CC 3 Fast A_FastChase
			1102 DD 3 Fast A_Chase
		Goto See
		Run:
			1102 A 0 A_Jump (24, "See")
			1102 AA 2 Fast A_Chase
			1102 BB 2 Fast A_Chase
			1102 CC 2 Fast A_Chase
			1102 DD 2 Fast A_Chase
		Loop
		MeleeState:
		MissileState:
			1102 E 6 Fast A_FaceTarget
			TNT1 A 0 A_SpawnItemEx ("bulletcasing", -8, 28, 34, -4, 0, frandom(3.0, 5.0), random(-80, -90))
			1102 F 5 Fast bright A_CustomMissile("UndeadInitiateBullet", 32, -8, frandom(-3.0, 3.0), 0, frandom(-2.0, 2.0))
			TNT1 A 0 A_PlaySound ("UndeadInitiate/Shoot", 6)
			1102 E 6 Fast A_FaceTarget
			TNT1 A 0 A_SpawnItemEx ("bulletcasing", -8, 7, 34, 4, 0, frandom(3.0, 5.0), random(-80, -90))
			TNT1 A 0 ACS_NamedExecuteAlways("DnD On Monster Attack", 0)
			1102 Y 5 Fast bright A_CustomMissile("UndeadInitiateBullet", 32, 8, frandom(-3.0, 3.0), 0, frandom(-2.0, 2.0))
			TNT1 A 0 A_PlaySound ("UndeadInitiate/Shoot", 6)
			1102 E 5 Fast
			1102 E 2 Fast A_CPosRefire
		Loop
		PainState:
			1102 G 3 Fast
			1102 G 3 Fast A_Pain
		goto See
		DeathState:
			1102 I 7 A_Scream
			1102 JK 7
			1102 L 7 A_NoBlocking
			1102 M 7
			1102 N -1
		Stop
		XDeathState:
			TNT1 A 0 A_SpawnDebris("NashGore_Gib9",0)
			TNT1 A 0 A_SpawnDebris("NashGore_Gib10",0)
			TNT1 A 0 A_SpawnDebris("NashGore_Gib11",0)
			TNT1 A 0 A_SpawnDebris("NashGore_Gib11",0)
			TNT1 A 0 A_SpawnItemEx("GenericGibber_Low_Delayed", 0, 0, 0, 0, 0, 0, 0, SXF_USEBLOODCOLOR)
			1102 O 5 A_Scream
			1102 R 5 A_NoBlocking
			1102 STUVW 5
			1102 X -1
		Stop
		RaiseState:
			1102 MLKJIH 6
		goto See
	}
}

Actor MrRobot : DnD_BaseRangedMonster {
	Obituary "%o wasn't welcome to the territory of a Robot Guard."
	Health 0x7FFFFFFF
	GibHealth -25
	Radius 20
	Height 56
	Mass 256
	Speed 9
	PainChance 96
	SeeSound "Robodude/See"
	PainSound "Robodude/pain"
	DeathSound "Robodude/die"
	ActiveSound "Robodude/act"
	DropItem "LaserPickup"
	Tag "Robot Guard"
	+ISMONSTER
	+NOBLOOD
	States {
		SetInfo:
			TNT1 A 0 A_SetArg(4, DND_MRROBOT)
			TNT1 A 0 ACS_NamedExecuteWithResult("DnD Init Monster Data", DND_MWEIGHT_VERYRARE)
		Goto SpawnSetup
	
		IdleState:
			MROB A 4 A_GiveInventory("DnD_SightChecker", 1)
		Loop
		SeeState:
			TNT1 A 0 A_Jump(96, "Sprint")
			MROB ABCD 6 Fast A_Chase
		Goto See
		Sprint:
			TNT1 A 0 A_SpawnItemEx("MrRobot_FrameA",0,0,0,0,0,0,0,128)
			MROB A 2 Fast A_Chase
			TNT1 A 0 A_SpawnItemEx("MrRobot_FrameA",0,0,0,0,0,0,0,128)
			MROB A 2 Fast A_Chase
			TNT1 A 0 A_SpawnItemEx("MrRobot_FrameB",0,0,0,0,0,0,0,128)
			MROB B 2 Fast A_Chase
			TNT1 A 0 A_SpawnItemEx("MrRobot_FrameB",0,0,0,0,0,0,0,128)
			MROB B 2 Fast A_Chase
			TNT1 A 0 A_SpawnItemEx("MrRobot_FrameC",0,0,0,0,0,0,0,128)
			MROB C 2 Fast A_Chase
			TNT1 A 0 A_SpawnItemEx("MrRobot_FrameC",0,0,0,0,0,0,0,128)
			MROB C 2 Fast A_Chase
			TNT1 A 0 A_SpawnItemEx("MrRobot_FrameD",0,0,0,0,0,0,0,128)
			MROB D 2 Fast A_Chase
			TNT1 A 0 A_SpawnItemEx("MrRobot_FrameD",0,0,0,0,0,0,0,128)
			MROB D 2 Fast A_Chase
		Loop
		MissileState:
			MROB E 4 Fast A_FaceTarget
		MissileLoop:
			TNT1 A 0 A_Playsound("Enforcer/Fire")
			MROB F 3 Fast Bright A_CustomMissile("EnforcerPlasma3", 50, -12)
			MROB E 2 Fast A_MonsterRefire(32, "Sprint")
		Loop
		PainState:
			MROB G 3 Fast A_SpawnDebris("MetalScrap")
			MROB G 3 Fast A_Pain
		Goto See
		DeathState:
		    MROB G 5
			MROB I 4 A_Scream
			MROB J 4 A_NoBlocking
			MROB KLMNO 3
			MROB P -1
		Stop
		XDeathState:
			MROB Q 5 A_Scream
			MROB R 4 A_NoBlocking
			TNT1 A 0 A_PlaySound("Robodude/Explode")
			TNT1 AA 0 A_SpawnDebris("MetalScrap_More")
			MROB STUV 3 Bright
			MROB W 4
			MROB X -1
		Stop
		RaiseState:
			MROB ONMLKJI 3
		Goto see
	}
}

Actor EnforcerPlasma3 : EnforcerPlasma2 {
	Damage (random(4, 8))
	DamageType "Energy"
	Stamina 16
	Speed 48
	+PIERCEARMOR
}

Actor MrRobot_FrameA {
	Alpha 0.75
	+NOGRAVITY
	+CLIENTSIDEONLY
	+DONTSPLASH
	+NOINTERACTION
	+NOCLIP
	
	States {
		Spawn:
			MROB A 2 A_FadeOut(0.15)
		Loop
	}
}

Actor MrRobot_FrameB : MrRobot_FrameA {
	States {
		Spawn:
			MROB B 2 A_FadeOut(0.15)
		Loop
	}
}

Actor MrRobot_FrameC : MrRobot_FrameA {
	States {
		Spawn:
			MROB C 2 A_FadeOut(0.15)
		Loop
	}
}


Actor MrRobot_FrameD : MrRobot_FrameA {
	States {
		Spawn:
			MROB D 2 A_FadeOut(0.15)
		Loop
	}
}

Actor MachinegunGuy : DnD_BaseRangedMonster {
	Health 0x7FFFFFFF
	GibHealth -25
	Tag "MG Zombie"
	Radius 20
	Height 56
	Mass 100
	Speed 8
	PainChance 170
	SeeSound "chainguy/sight"
	PainSound "chainguy/pain"
	DeathSound "chainguy/death"
	ActiveSound "chainguy/active"
	AttackSound "Weapons/MGFireSoft"
	Obituary "$OB_CHAINGUY"
	DropItem "MachinegunPickup_Drop"
	+ISMONSTER
	States {
		SetInfo:
			TNT1 A 0 A_SetArg(4, DND_ZOMBIEMG)
			TNT1 A 0 ACS_NamedExecuteWithResult("DnD Init Monster Data", DND_MWEIGHT_UNCOMMON)
		Goto SpawnSetup
	
		IdleState:
			EASS AB 10 A_GiveInventory("DnD_SightChecker", 1)
		Loop
		SeeState:
			EASS AABBCCDD 3 Fast A_Chase
		Goto See
		MissileState:
			EASS E 10 Fast A_FaceTarget
			TNT1 A 0 A_PlaySound("Weapons/MGFireSoft")
			TNT1 A 0 A_SpawnItemEx ("bulletcasing", -8, 7, 26, 4, 0, frandom(3.0, 5.0), random(-80, -90))
			EASS F 3 Fast Bright A_CustomMissile("ZombieBullet", 32, 8, frandom(-22.5, 22.5), 0, frandom(-1.5, 1.5))
			TNT1 A 0 ACS_NamedExecuteAlways("DnD On Monster Attack", 0)
			TNT1 A 0 A_PlaySound("Weapons/MGFireSoft")
			TNT1 A 0 A_SpawnItemEx ("bulletcasing", -8, 7, 26, 4, 0, frandom(3.0, 5.0), random(-80, -90))
			EASS E 3 Bright A_CustomMissile("ZombieBullet", 32, 8, frandom(-22.5, 22.5), 0, frandom(-1.5, 1.5))
			EASS F 1 A_CPosRefire
		Goto MissileState + 1
		PainState:
			EASS G 3 Fast
			EASS G 3 Fast A_Pain
		Goto See
		DeathState:
			EASS H 5
			EASS I 5 A_Scream
			EASS J 5 A_NoBlocking
			EASS K 5
			EASS L -1
		Stop
		RaiseState:
			EASS KJIH 5
		Goto See
		XDeathState:
			TNT1 A 0 A_SpawnDebris("NashGore_Gib9",0)
			TNT1 A 0 A_SpawnDebris("NashGore_Gib10",0)
			TNT1 A 0 A_SpawnDebris("NashGore_Gib11",0)
			TNT1 A 0 A_SpawnDebris("NashGore_Gib11",0)
			TNT1 A 0 A_SpawnItemEx("GenericGibber_Low_Delayed", 0, 0, 0, 0, 0, 0, 0, SXF_USEBLOODCOLOR)
			EASS M 5
			ZHRF N 5 A_XScream
			ZHRF O 5 A_NoBlocking
			ZHRF PQRST 5
			ZHRF U -1	
		Stop
	}
}

ACTOR PlasmaZombie : DnD_BaseRangedMonster {
    Health 0x7FFFFFFF
	GibHealth -25
    Radius 20
    Height 56
    Speed 6
    PainChance 128
    SeeSound "grunt/sight"
    AttackSound "grunt/attack"
    PainSound "grunt/pain"
    DeathSound "grunt/death"
    ActiveSound "grunt/active"
    Obituary "%o got burned by a plasma zombie."
    DropItem "PlasmaBolterPickup"
	+ISMONSTER
    States {
		SetInfo:
			TNT1 A 0 A_SetArg(4, DND_PLASMAZOMBIE)
			TNT1 A 0 ACS_NamedExecuteWithResult("DnD Init Monster Data", DND_MWEIGHT_RARE2)
		Goto SpawnSetup

		IdleState:
			ZMAY AB 10 A_GiveInventory("DnD_SightChecker", 1)
		Loop
		SeeState:
			ZMAY AABBCCDD 4 Fast A_Chase
		Goto See
		MissileState:
			ZMAY E 10 Fast A_FaceTarget
			ZMAY F 3 Fast A_CustomMissile("ZombiePlasma", 32, 4, frandom(-1.5, 1.5))
			ZMAY E 5 Fast A_FaceTarget
			ZMAY F 3 Fast A_CustomMissile("ZombiePlasma", 32, 4, frandom(-1.5, 1.5))
			ZMAY E 5 Fast A_FaceTarget
			ZMAY F 3 Fast A_CustomMissile("ZombiePlasma", 32, 4, frandom(-1.5, 1.5))
			ZMAY E 5 Fast A_FaceTarget
			TNT1 A 0 ACS_NamedExecuteAlways("DnD On Monster Attack", 0)
			ZMAY F 3 Fast A_CustomMissile("ZombiePlasma", 32, 4, frandom(-1.5, 1.5))
			ZMAY E 5 Fast A_FaceTarget
			ZMAY F 3 Fast A_CustomMissile("ZombiePlasma", 32, 4, frandom(-1.5, 1.5))
			ZMAY E 5 A_MonsterRefire(120, "See")
		Goto MissileState + 1
		PainState:
			ZMAY G 3 Fast
			ZMAY G 3 Fast A_Pain
		Goto See
		DeathState:
			ZMAY H 5
			ZMAY I 5 A_Scream
			ZMAY J 5 A_Fall
			ZMAY K 5
			ZMAY L -1
		Stop
		XDeathState:
			TNT1 A 0 A_SpawnDebris("NashGore_Gib9",0)
			TNT1 A 0 A_SpawnDebris("NashGore_Gib10",0)
			TNT1 A 0 A_SpawnDebris("NashGore_Gib11",0)
			TNT1 A 0 A_SpawnDebris("NashGore_Gib11",0)
			TNT1 A 0 A_SpawnItemEx("GenericGibber_Low_Delayed", 0, 0, 0, 0, 0, 0, 0, SXF_USEBLOODCOLOR)
			ZMAY O 5
			ZMAY P 5 A_XScream
			ZMAY Q 5 A_NoBlocking
			ZMAY RSTU 5
			ZMAY V -1
		Stop
		RaiseState:
			ZMAY KJIH 5
		Goto See
    }
}

Actor ZombiePlasma : PlasmaBallX {	
	Radius 8
	Height 16
	Speed 25
	+RANDOMIZE
	RenderStyle Add
	Alpha 0.75
	Decal "PlasmaScorchX"
	Damage(15)
	DamageType "Energy"
	Stamina 16
	Translation "0:255=%[0.00,0.00,0.00]:[1.05,1.05,2.00]", "4:4=4:4", "224:229=224:229"
	SeeSound "weapons/plasmaf"
	DeathSound "weapons/plasmax"
	
	States {
		Spawn:
			TNT1 A 0 NoDelay ACS_NamedExecuteAlways("DnD Pierce Check")
		SpawnLoop:
			PLSS AAABBB 2 Bright A_SpawnItemEx("BlueParticleNoGravityFastVanish",Random(-12,12),Random(-12,12),Random(-12,12),Random(-2,2),Random(-2,2),Random(-2,2),Random(-20,20),128)
		Loop
		Death:
			TNT1 A 0 A_SpawnItemEx ("PlasmaFlare", 0, 0, 0, 0, 0, 0, 0, SXF_CLIENTSIDE | SXF_NOCHECKPOSITION, 0)
			PLSE ABCDE 4 Bright
		Stop
	}
}

Actor Berserkerguy : DnD_BaseRangedMonster {
	Obituary "%o was surprised by the tenacity of a Berserk Chaingunner."
	Health 0x7FFFFFFF
	GibHealth -25
	Radius 20
	Height 56
	Mass 256
	Speed 8
	PainChance 144
	SeeSound "FancyZombie/sight"
	AttackSound "weapons/minigunfire"
	PainSound "FancyZombie/pain"
	DeathSound "FancyZombie/death"
	ActiveSound "FancyZombie/Idle"
	DropItem "RipperCannonPickup"
	Tag "Berserk Chaingunner"
	+ISMONSTER
	States {
		SetInfo:
			TNT1 A 0 A_SetArg(4, DND_BERSERKERGUY)
			TNT1 A 0 ACS_NamedExecuteWithResult("DnD Init Monster Data", DND_MWEIGHT_VERYRARE)
		Goto SpawnSetup
	
		IdleState:
			CGOS AB 10 A_GiveInventory("DnD_SightChecker", 1)
		Loop
		SeeState:
			TNT1 A 0 A_JumpIfHealthLower (ACS_ExecuteWithResult(961, 7) / 2, "See2")
			CGOS AABBCCDD 3 Fast A_Chase
		Goto See
		See2:
			CGOS AABBCCDD 2 Fast A_Chase
		Goto See
		MissileState:
			TNT1 A 0 A_PlaySound("FancyZombie/Attack")
			CGOS E 12 Fast A_FaceTarget
		MissileDecide:
			TNT1 A 0 A_JumpIfHealthLower (ACS_ExecuteWithResult(961, 7) / 4, "Missile2")
			TNT1 A 0 A_JumpIfHealthLower (ACS_ExecuteWithResult(961, 7) / 2, "Missile3")
			TNT1 A 0 A_PlaySound("weapons/minigunfire", CHAN_WEAPON)
			TNT1 A 0 A_SpawnItemEx ("bulletcasing", -8, 7, 26, 4, 0, frandom(3.0, 5.0), random(-80, -90))
			CGOS F 4 Fast Bright A_CustomMissile("ZombieBullet", 32, 7, frandom(-16.5, 16.5))
			TNT1 A 0 A_PlaySound("weapons/minigunfire", CHAN_WEAPON)
			TNT1 A 0 A_SpawnItemEx ("bulletcasing", -8, 7, 26, 4, 0, frandom(3.0, 5.0), random(-80, -90))
			TNT1 A 0 
			CGOS E 4 Fast Bright A_CustomMissile("ZombieBullet", 32, 7, frandom(16.5, 16.5))
			CGOS F 1 A_CPosRefire
		Goto MissileDecide
		Missile2:
			TNT1 A 0 A_PlaySound("weapons/minigunfire", CHAN_WEAPON)
			TNT1 A 0 A_SpawnItemEx ("bulletcasing", -8, 7, 26, 4, 0, frandom(3.0, 5.0), random(-80, -90))
			TNT1 A 0 A_SetAngle(angle + frandom(-8.0, 8.0))
			CGOS F 2 Fast Bright A_CustomMissile("ZombieBullet", 32, 7, frandom(-22.5, 22.5))
			TNT1 A 0 A_PlaySound("weapons/minigunfire", CHAN_WEAPON)
			TNT1 A 0 A_SpawnItemEx ("bulletcasing", -8, 7, 26, 4, 0, frandom(3.0, 5.0), random(-80, -90))
			TNT1 A 0 A_SetAngle(angle + frandom(-8.0, 8.0))
			CGOS E 2 Fast Bright A_CustomMissile("ZombieBullet", 32, 7, frandom(-22.5, 22.5))
			CGOS F 1 A_CPosRefire
		Goto MissileDecide
		Missile3:
			TNT1 A 0 A_PlaySound("weapons/minigunfire", CHAN_WEAPON)
			TNT1 A 0 A_SpawnItemEx ("bulletcasing", -8, 7, 26, 4, 0, frandom(3.0, 5.0), random(-80, -90))
			TNT1 A 0 A_SetAngle(angle + frandom(-4.0, 4.0))
			CGOS F 3 Fast Bright A_CustomMissile("ZombieBullet", 32, 7, frandom(-19.5, 19.5))
			TNT1 A 0 A_PlaySound("weapons/minigunfire", CHAN_WEAPON)
			TNT1 A 0 A_SpawnItemEx ("bulletcasing", -8, 7, 26, 4, 0, frandom(3.0, 5.0), random(-80, -90))
			TNT1 A 0 A_SetAngle(angle + frandom(-4.0, 4.0))
			CGOS E 3 Fast Bright A_CustomMissile("ZombieBullet", 32, 7, frandom(-19.5, 19.5))
			CGOS F 1 A_CPosRefire
		Goto MissileDecide
		PainState:
			CGOS G 3 Fast
			CGOS G 3 Fast A_Pain
		Goto See
		DeathState:
			CGOS H 5
			CGOS I 5 A_Scream
			CGOS J 5 A_NoBlocking
			CGOS KLM 5
			CGOS N -1
		Stop
		XDeathState:
			TNT1 A 0 A_SpawnDebris("NashGore_Gib9",0)
			TNT1 A 0 A_SpawnDebris("NashGore_Gib10",0)
			TNT1 A 0 A_SpawnDebris("NashGore_Gib11",0)
			TNT1 A 0 A_SpawnDebris("NashGore_Gib11",0)
			TNT1 A 0 A_SpawnItemEx("GenericGibber_Low_Delayed", 0, 0, 0, 0, 0, 0, 0, SXF_USEBLOODCOLOR)
			CGOS O 5
			CGOS P 5 A_XScream
			CGOS Q 5 A_NoBlocking
			CGOS RS 5
			CGOS T -1
		Stop
		RaiseState:
			CGOS NMLKJIH 5
		Goto See
	}
}