ACTOR FriendMarineRapidShotgun : BaseMarine
{
	AttackSound " "
	Translation "112:127=192:205"
	var int user_attack;
	States
	{
	Spawn:
		PLRP A 1
		"####" A 0 A_GiveInventory("TargetIsAMarine")
		PLRP A 1 A_Look
		Loop
	Missile:
        "####" A 0
        "####" A 0 A_ChangeFlag("NODROPOFF", 1)
		"####" A 0 A_JumpIfInTargetInventory("TargetIsAMarine", 1, "FollowPlayer")
		"####" A 0 A_JumpIfInTargetInventory("IsPlayer", 1, "CheckRangeToWait")
		"####" A 0 A_ChangeFlag("SHOOTABLE", 1)
		"####" A 0 A_ChangeFlag("SOLID", 0)
		"####" A 0 A_JumpIfCloser(200, "Retreat")
		"####" A 0 A_FaceTarget
		"####" A 1 A_Chase ("","")
		"####" A 0 A_JumpIfInTargetInventory("IsPlayer", 1, "CheckRangeToWait")
		Goto Strafe
	Strafe:
		"####" A 0 A_Jump(128, "Attack")
		"####" A 0 ThrustThing(Angle*256/360+64,12,0,0)
		"####" AABBCCDD 2 A_Chase
		"####" A 0 A_Stop
		Goto Attack
	Attack:
		"####" A 0 A_SetUserVar("user_attack",1)
		"####" A 0 A_PlaySound("HeavyChaingun/Sart",CHAN_WEAPON,1.0,0)
		"####" A 0 A_JumpIfCloser(250,"CloserAttack")
		"####" EE 5 A_FaceTarget
	AttackLoop:
		"####" A 0 A_JumpIfInTargetInventory("IsPlayer", 1, "CheckRangeToWait")
		"####" A 0 A_PlaySound("HeavyChaingun/Loop",CHAN_WEAPON,1.0,1)
		"####" AAAA 0 A_CustomMissile("MonsterTracer2",random(28,34),0,random(-6,6),CMF_OFFSETPITCH,frandom(-3.0,3.0))
		"####" A 0 A_SpawnItemEx("ShellCasing",12,-6,36,random(2,6),0,random(1,3),random(-80,-90),SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
		"####" A 0 A_PlaySound("weapons/12gaugefire",6)
		"####" A 0 Bright A_CustomBulletAttack(22.5,18.3,4,random(1,5)*3,"FriendlyMarineBulletPuff",2048,CBAF_NOrandom)
		"####" E 4 Bright A_CustomBulletAttack(0,0,1,random(1,5)*3,"FriendlyMarineBulletPuff",2048,CBAF_NOrandom)
		"####" A 0 A_FaceTarget
		"####" AAAA 0 A_CustomMissile("MonsterTracer2",random(28,34),0,random(-6,6),CMF_OFFSETPITCH,frandom(-3.0,3.0))
		"####" A 0 A_SpawnItemEx("ShellCasing",12,-6,36,random(2,6),0,random(1,3),random(-80,-90),SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
		"####" A 0 A_PlaySound("weapons/12gaugefire",6)
		"####" A 0 Bright A_CustomBulletAttack(22.5,18.3,4,random(1,5)*3,"FriendlyMarineBulletPuff",2048,CBAF_NOrandom)
		"####" F 4 Bright A_CustomBulletAttack(0,0,1,random(1,5)*3,"FriendlyMarineBulletPuff",8192,CBAF_NOrandom)
		"####" A 0 A_MonsterRefire(0,"MissileEnd")
		"####" A 0 A_Jump(20,"Pause")
		Loop
	CloserAttack:
		"####" A 0 A_GiveInventory("ZombieShieldSphere",1)
		"####" A 1 A_GiveInventory("HEMCommandoStrafing",1)
		"####" A 1 A_FaceTarget
		"####" A 1 A_FaceTarget
		"####" B 1 A_GiveInventory("HEMCommandoStrafing",1)
		"####" B 1 A_FaceTarget
		"####" B 1 A_FaceTarget
		"####" C 1 A_GiveInventory("HEMCommandoStrafing",1)
		"####" C 1 A_FaceTarget
		"####" C 1 A_FaceTarget
		"####" D 1 A_GiveInventory("HEMCommandoStrafing",1)
		"####" D 1 A_FaceTarget
		"####" D 1 A_FaceTarget
	Refire2:
		"####" A 0 A_JumpIfInTargetInventory("IsPlayer", 1, "CheckRangeToWait")
		"####" A 0 A_PlaySound("HeavyChaingun/Loop",CHAN_WEAPON,1.0,1)
		"####" AAAA 0 A_CustomMissile("MonsterTracer2",random(28,34),0,random(-6,6),CMF_OFFSETPITCH,frandom(-3.0,3.0))
		"####" A 0 A_SpawnItemEx("ShellCasing",12,-6,36,random(2,6),0,random(1,3),random(-80,-90),SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
		"####" A 0 A_PlaySound("weapons/12gaugefire",6)
		"####" A 0 Bright A_CustomBulletAttack(22.5,18.3,4,random(1,5)*3,"FriendlyMarineBulletPuff",2048,CBAF_NOrandom)
		"####" A 0 A_GiveInventory("HEMCommandoStrafing",1)
		"####" E 4 Bright A_CustomBulletAttack(0,0,1,random(1,5)*3,"FriendlyMarineBulletPuff",2048,CBAF_NOrandom)
		"####" AAAA 0 A_CustomMissile("MonsterTracer2",random(28,34),0,random(-6,6),CMF_OFFSETPITCH,frandom(-3.0,3.0))
		"####" A 0 A_SpawnItemEx("ShellCasing",12,-6,36,random(2,6),0,random(1,3),random(-80,-90),SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
		"####" A 0 A_PlaySound("weapons/12gaugefire",6)
		"####" A 0 Bright A_CustomBulletAttack(22.5,18.3,4,random(1,5)*3,"FriendlyMarineBulletPuff",2048,CBAF_NOrandom)
		"####" A 0 A_GiveInventory("HEMCommandoStrafing",1)
		"####" F 4 Bright A_CustomBulletAttack(0,0,1,random(1,5)*3,"FriendlyMarineBulletPuff",2048,CBAF_NOrandom)
		"####" AAAA 0 A_CustomMissile("MonsterTracer2",random(28,34),0,random(-6,6),CMF_OFFSETPITCH,frandom(-3.0,3.0))
		"####" A 0 A_SpawnItemEx("ShellCasing",12,-6,36,random(2,6),0,random(1,3),random(-80,-90),SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
		"####" A 0 A_PlaySound("weapons/12gaugefire",6)
		"####" A 0 Bright A_CustomBulletAttack(22.5,18.3,4,random(1,5)*3,"FriendlyMarineBulletPuff",2048,CBAF_NOrandom)
		"####" A 0 A_GiveInventory("HEMCommandoStrafing",1)
		"####" E 4 Bright A_CustomBulletAttack(0,0,1,random(1,5)*3,"FriendlyMarineBulletPuff",2048,CBAF_NOrandom)
		"####" AAAA 0 A_CustomMissile("MonsterTracer2",random(28,34),0,random(-6,6),CMF_OFFSETPITCH,frandom(-3.0,3.0))
		"####" A 0 A_SpawnItemEx("ShellCasing",12,-6,36,random(2,6),0,random(1,3),random(-80,-90),SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
		"####" A 0 A_PlaySound("weapons/12gaugefire",6)
		"####" A 0 Bright A_CustomBulletAttack(22.5,18.3,4,random(1,5)*3,"FriendlyMarineBulletPuff",2048,CBAF_NOrandom)
		"####" A 0 A_GiveInventory("HEMCommandoStrafing",1)
		"####" F 4 Bright A_CustomBulletAttack(0,0,1,random(1,5)*3,"FriendlyMarineBulletPuff",2048,CBAF_NOrandom)
		"####" A 0 A_MonsterRefire(0,"MissileEnd")
		"####" A 0 A_Jump(15,"Pause")
		Loop
	MissileEnd:
		"####" A 0
		"####" A 0 A_SetUserVar("user_attack",0)
		"####" A 0 A_PlaySound("HeavyChaingun/Down",CHAN_WEAPON,1.0,0)
		Goto See
	Pause:
		"####" A 0
		"####" A 0 A_SetUserVar("user_attack",0)
		"####" A 0 A_PlaySound("HeavyChaingun/Down",CHAN_WEAPON,1.0,0)
		"####" A 15 A_FaceTarget
		Goto See
	Retreat:
		"####" A 0
		"####" A 2 A_Recoil(4)
		"####" A 0 A_FaceTarget
		"####" A 0 
		"####" B 2 A_Recoil(4)
		"####" A 0 A_FaceTarget
		"####" A 0 
		"####" C 2 A_Recoil(4)
		"####" A 0 A_FaceTarget
		"####" D 2 A_Recoil(4)
		"####" A 0 A_FaceTarget
		Goto Attack
		}
}