ACTOR ShotGunner : shotgunguy replaces shotgunguy
{
	Speed 10
	Obituary "%o ate buckshot from a shotgunner."
	+DOHARMSPECIES
	DropItem "Shotgun"
	SeeSound "shotgunner/see"
	PainSound "shotgunner/pain"
	DeathSound "shotgunner/die"
	AttackSound "shotgunner/attack"
	ActiveSound "zomrfile/idle"
	States
	{
	Spawn:
		ZSP1 AB 10 A_Look
		Loop
	See:
		ZSP1 AABBCCDD 3 A_Chase
		Loop
	Missile:
		ZSP1 E 15 A_FaceTarget
		TNT1 A 0 a_jump (60, "whiplashshot")
		TNT1 A 0 a_jump (90, "ConsiderGrenade")
	NormalShot:
		ZSP1 F 1 Bright
		ZSP1 F 4 Bright A_SPosAttackUseAtkSound
		ZSP1 E 3
		ZSP1 E 10 A_CustomMissile("monstershellspawner",30,3)
		Goto See
	whiplashshot:
		ZSP1 D 15 A_FaceTarget
		ZSP1 C 2 A_PlaySound ("Shotgunner/swing")
		TNT1 AAAA 0 A_CustomMissile("monstershellspawner",30,3)
		ZSP1 B 2 A_playsound ("shotgunner/shellcram")
		ZSP1 D 16 A_FaceTarget
		ZSP1 E 16 A_FaceTarget
		TNT1 A 0 A_PlaySound("shotgunner/bigshot", 0)
		CRMD G 0 A_custommissile("EvilPellet", 30, 13, frandom(3,-3), CMF_OFFSETPITCH, frandom(2,-2))
		CRMD G 0 A_custommissile("EvilPellet", 30, 13, frandom(3,-3), CMF_OFFSETPITCH, frandom(2,-2))
		CRMD G 0 A_custommissile("EvilPellet", 30, 13, frandom(3,-3), CMF_OFFSETPITCH, frandom(2,-2))
		CRMD G 0 A_custommissile("EvilPellet", 30, 13, frandom(3,-3), CMF_OFFSETPITCH, frandom(2,-2))
		CRMD G 0 A_custommissile("EvilPellet", 30, 13, frandom(3,-3), CMF_OFFSETPITCH, frandom(2,-2))
		CRMD G 0 A_custommissile("EvilPellet", 30, 13, frandom(3,-3), CMF_OFFSETPITCH, frandom(2,-2))
		CRMD G 0 A_custommissile("EvilPellet", 30, 13, frandom(3,-3), CMF_OFFSETPITCH, frandom(2,-2))
		CRMD G 0 A_custommissile("EvilPellet", 30, 13, frandom(3,-3), CMF_OFFSETPITCH, frandom(2,-2))
		CRMD G 0 A_custommissile("EvilPellet", 30, 13, frandom(3,-3), CMF_OFFSETPITCH, frandom(2,-2))
		CRMD G 0 A_custommissile("EvilPellet", 30, 13, frandom(3,-3), CMF_OFFSETPITCH, frandom(2,-2))
		ZSP1 F 2 Bright A_custommissile("EvilPellet", 30, 13, frandom(3,-3), CMF_OFFSETPITCH, frandom(2,-2))
		TNT1 A 0 a_facetarget
		TNT1 A 0 ThrustThing(angle*256/360+128, 40, 0, 0)
		TNT1 A 0 ThrustThingZ (0, 25, 0, 0)	
		ZSP1 F 4
		ZSP1 E 3
		TNT1 AAAAAAAA 0 A_CustomMissile("monstershellspawner",30,3)
		ZSP1 E 10 A_CustomMissile("monstershellspawner",30,3)
		ZSP1 E 8
		Goto See
	ConsiderGrenade:
		ZSP1 E 1 A_FaceTarget
		TNT1 A 0 a_jumpifcloser (220,"CancelGrenade") //If target's too close, don't shoot the grenade, you might blow yourself up, idiot.
		TNT1 A 0 a_playsound ("Malefactors/GrenadeReady",0,1,0,0.6)
		ZSP1 E 8 A_FaceTarget
		ZSP1 E 1 a_jumpifcloser (650,"FireGrenade")
		ZSP1 E 10 a_playsound ("Malefactors/GrenadeCancel",0,1,0,0.6)
		ZSP1 A 10 a_facetarget
		ZSP1 E 9 A_FaceTarget	
		goto normalshot
	FireGrenade:
		TNT1 A 0
		ZSP1 E 8 A_FaceTarget
		TNT1 A 0 a_jumpifcloser (220,"CancelGrenade") //If target's too close, don't shoot the grenade, you might blow yourself up, idiot.
		ZSP1 E 15 A_FaceTarget
		TNT1 A 0 a_playsound ("Malefactors/GrenadeShot",0)
		ZSP1 F 4 bright A_CustomMissile("CAZombieGrenade",30,3)
		TNT1 A 0 a_recoil (6)
		ZSP1 E 10
		goto see		
	CancelGrenade:
		ZSP1 G 3
		ZSP1 G 3 A_Pain
		ZSP1 E 10 a_playsound ("Malefactors/GrenadeCancel",0,1,0,0.6)
		Goto See		



	Pain:
		ZSP1 G 3
		ZSP1 G 3 A_Pain
		Goto See
	Death:
		ZSP1 H 5
		ZSP1 I 5 A_Scream
		ZSP1 J 5 A_NoBlocking
		ZSP1 K 5
		ZSP1 L -1
		Stop
	Death.CABladeBeam:
		TNT1 A 0
		TNT1 A 0 a_facetarget
		TNT1 A 0 a_scream
		TNT1 A 0 a_noblocking
		TNT1 A 0 a_spawnitemex ("MalefactorShotgunnerTorso",0,0,36,random(-3,3),random(-3,3),random (1,2),0,SXF_NOCHECKPOSITION)
		TNT1 A 0 a_playsound ("Malefactors/BladeBeamDeath1",0,1,0,0.90)
		8DX2 B random (45,50)
		TNT1 AAA 0 a_spawnitemex("FireDebris",0,0,random(3,8),random(-8,8),random(-7,7),random(6,7),0,SXF_NOCHECKPOSITION)
		TNT1 A 0 a_playsound ("Malefactors/BladeBeamExplosion",0,0.80,0)
		TNT1 A 0 A_SpawnItemEx("MonsterFireExplosion",0,0,30)
		stop
	XDeath:
		SPOS M 5 A_NoBlocking
		TNT1 A 0 a_playsound ("MaleFactors/Gib",0,0.80)
		TNT1 AAA 0 a_spawnitemex("CAXblood",0,0,10,random(-7,7),random(-6,6),random(10,12))
		TNT1 AAA 0 a_spawnitemex("CAXblood",0,0,10,random(-8,8),random(-10,10),random(9,14))
    	TNT1 A 0 BRIGHT a_spawnitemex("CAMonsterBlud",0,0,0,random(-3,8),random(-6,8),random(10,12))
    	TNT1 A 0 BRIGHT a_spawnitemex("CAMonsterBlud",0,0,0,random(-6,12),random(-10,10),random(10,12))
    	TNT1 A 0 BRIGHT a_spawnitemex("cs_go",0,0,0,random(-7,10),random(-9,12),random(10,12))
    	TNT1 A 0 BRIGHT a_spawnitemex("cs_go",0,0,0,random(-3,16),random(-10,16),random(10,12))
    	TNT1 A 0 BRIGHT A_PlaySound("CABsplat")	
		SPOS N 5 A_XScream
		SPOS O 5 
		SPOS PQRST 5
		SPOS U -1
		Stop
	Death.CALinkedBomb:
	death.CALinked:
		TNT1 A 0
		TNT1 A 0 a_scream
		TNT1 A 0 a_noblocking
		TNT1 A 0 a_changeflag ("THRUACTORS",1)
		TNT1 A 0 a_stop
		TNT1 A 0 a_playsound ("Malefactors/LinkedHurt",0,0.80)
		TNT1 A 1 a_spawnitemex ("CALinkedKill",0,0,35)
		TNT1 A 0 a_playsound ("Malefactors/LinkedDeath",0,1,0,0.90)
		TNT1 A 2
		TNT1 A 3 ThrustThingZ (0,30,0,1)
		L1ST B 2
		L1ST B -1
		wait

	Raise:
		TNT1 A 0
		TNT1 A 0 a_changeflag ("THRUACTORS",0)
		ZSP1 L 5
		ZSP1 KJIH 5
		Goto See

	}
}

actor Evilpellet : fastprojectile
{
	projectile
    +FORCEXYBILLBOARD	
    +BLOODSPLATTER
	missiletype "Monsterbullettracer"
    missileheight 10
	height 4
	radius 4
	speed 60
	damage 1
    Scale 0.2
	Decal bulletchip
	alpha 0.55
	states
	{
	spawn:
		TNT1 A 1
		loop
	death:
		TNT1 A 0
		TNT1 A 1
		PUFF A 0
		PUFF A 3 Bright A_SpawnDebris("MonsterSpark")
		PUFF B 3 Bright A_SetTranslucent(.75,0)
		PUFF C 3 Bright A_SetTranslucent(.5,0)
		PUFF D 3 Bright A_SetTranslucent(.25,0)
		stop
	xdeath:
		TNT1 A 0
		TNT1 A 1
		stop
	}
}


actor MalefactorShotgunnerTorso : MalefactorRiflemanTorso
{
	gravity 0.80
    States
    {
    Spawn:
		TNT1 A 0
		8DX2 A 6
		TNT1 A 0 a_scalevelocity (0.30)
		8DX2 A 6
		TNT1 A 0 a_scalevelocity (0.50)
		8DX2 A 6
		TNT1 A 0 a_stop
		8DX2 A 10
		TNT1 A 0 a_changeflag ("NOGRAVITY",0)
		TNT1 A 0 a_changeflag ("HEXENBOUNCE",0)
	Falling:
		8DX2 A 1
		TNT1 A 0 A_CheckFloor ("Death")
		loop
    }
}
	
