//-----------------------------------------------------------------
//-----------------------------------------------------------------
// Bipedicus
//-----------------------------------------------------------------
//-----------------------------------------------------------------
Actor D4Bipedicus : D4ShotgunGuy replaces FlemoidusBipedicus
{
	Health 50
	SeeSound "shotguy/sight"
	AttackSound "shotguy/attack"
	PainSound "shotguy/pain"
	DeathSound "shotguy/death"
	ActiveSound "shotguy/active"
	Obituary "$OB_SHOTGUY"
	Tag "Flemoidus Bipedicus"
	Translation ""
	BloodColor "Green"
	States
	{
	Spawn:
		SPOS A 0 NODELAY A_SetUserVar(user_bigmonstersound,0)
		Goto Idle
	Idle:
		SPOS A 10 A_Look
		Loop
	See:
		SPOS AABBCCDD 3 A_Chase
		Loop
	
		
	//------------------------	
	Missile:
		TNT1 A 0 A_PlaySound("Doom4/Monsters/Grunt/AttackOneInEight",CHAN_AUTO,1.0,false,1.2)
		TNT1 A 0 A_Jump(200,"PlasmaBurst") // most of the time will do the plasma 4shot
		
	//------------------------
	PlasmaBomb:
		TNT1 A 0 A_JumpIfCloser(64,"PlasmaBurst")	//if too close, goes to plasmaburst anyway
		SPOS E 0 A_PlaySound("Doom4/Other/ZombieChargeAtt",CHAN_AUTO,1.0,false,1.0)
		SPOS EEEEEEE 5 A_FaceTarget
		TNT1 A 0 A_JumpIfCloser(128,"PlasmaExplo128")
		TNT1 A 0 A_JumpIfCloser(192,"PlasmaExplo192")
		TNT1 A 0 A_JumpIfCloser(256,"PlasmaExplo256")
		TNT1 A 0 A_JumpIfCloser(320,"PlasmaExplo320")
		TNT1 A 0 A_JumpIfCloser(384,"PlasmaExplo384")
		TNT1 A 0 A_JumpIfCloser(448,"PlasmaExplo448")
		TNT1 A 0 A_JumpIfCloser(512,"PlasmaExplo512")
		TNT1 A 0 A_JumpIfCloser(576,"PlasmaExplo576")
		TNT1 A 0 A_JumpIfCloser(640,"PlasmaExplo640")
		TNT1 A 0 A_JumpIfCloser(704,"PlasmaExplo704")
		TNT1 A 0 A_JumpIfCloser(768,"PlasmaExplo768")
		TNT1 A 0 A_JumpIfCloser(832,"PlasmaExplo832")
		
		PlasmaExplo128:
			TNT1 A 0 A_CustomMissile("FlemExploder128",35,0,0)
			Goto FinishPlasmaExplo
		PlasmaExplo192:
			TNT1 A 0 A_CustomMissile("FlemExploder192",35,0,0)
			Goto FinishPlasmaExplo
		PlasmaExplo256:
			TNT1 A 0 A_CustomMissile("FlemExploder256",35,0,0)
			Goto FinishPlasmaExplo
		PlasmaExplo320:
			TNT1 A 0 A_CustomMissile("FlemExploder320",35,0,0)
			Goto FinishPlasmaExplo
		PlasmaExplo384:
			TNT1 A 0 A_CustomMissile("FlemExploder384",35,0,0)
			Goto FinishPlasmaExplo
		PlasmaExplo448:
			TNT1 A 0 A_CustomMissile("FlemExploder448",35,0,0)
			Goto FinishPlasmaExplo
		PlasmaExplo512:
			TNT1 A 0 A_CustomMissile("FlemExploder512",35,0,0)
			Goto FinishPlasmaExplo
		PlasmaExplo576:
			TNT1 A 0 A_CustomMissile("FlemExploder576",35,0,0)
			Goto FinishPlasmaExplo
		PlasmaExplo640:
			TNT1 A 0 A_CustomMissile("FlemExploder640",35,0,0)
			Goto FinishPlasmaExplo
		PlasmaExplo704:
			TNT1 A 0 A_CustomMissile("FlemExploder704",35,0,0)
			Goto FinishPlasmaExplo
		PlasmaExplo768:
			TNT1 A 0 A_CustomMissile("FlemExploder768",35,0,0)
			Goto FinishPlasmaExplo
		PlasmaExplo832:
			TNT1 A 0 A_CustomMissile("FlemExploder832",35,0,0)
			Goto FinishPlasmaExplo
			
	FinishPlasmaExplo:
		TNT1 A 0 A_PlaySound("Doom4/Monsters/ZombieBigPlasmaShoot",CHAN_AUTO,1.0,false,0.9)
		SPOS F 5 Bright
		SPOS E 15
		Goto See
	
	//------------------------
	PlasmaBurst:
		SPOS E 10 A_FaceTarget
		SPOS F 5 Bright A_CustomMissile("FlemPlasmaBall",31,7,0)
		SPOS E 5 A_FaceTarget
		SPOS F 5 Bright A_CustomMissile("FlemPlasmaBall",31,7,0)
		SPOS E 5 A_FaceTarget
		SPOS F 5 Bright A_CustomMissile("FlemPlasmaBall",31,7,0)
		SPOS E 5 A_FaceTarget
		SPOS F 5 Bright A_CustomMissile("FlemPlasmaBall",31,7,0)
		SPOS E 5 A_FaceTarget
		Goto See
	
	Pain:
		SPOS G 3
		SPOS G 3 A_Pain
		Goto See

	Death:
		"####" "#" 0 A_SpawnItemEx("SituationalPinata",0,0,32,0,0,0,0,SXF_NOCHECKPOSITION|SXF_TRANSFERPOINTERS)
		SPOS H 4 
		SPOS I 4 A_Scream
		SPOS J 4 A_NoBlocking
		SPOS K 4
		SPOS L -1 
		Stop
	
	Raise:
		SPOS LK 3
		SPOS JIH 3
		Goto See
		
	//-------------------------
	// Regular chainsaw kill
	Death.ChainsawKill:
		TNT1 A 0 A_SpawnItemEx("D4PinataHealth",0,0,0,frandom(-4,4),frandom(-4,4),frandom(1,5),0,SXF_NOCHECKPOSITION)
		Goto XDeath
	//-------------------------
	// Chainsaw execution	
	Death.ChainsawPinata:	
		TNT1 A 0 A_GiveToTarget("SuccessfulExecutionToken",1)
		TNT1 A 0 A_SpawnItemEx("ChainsawExecutionPinata",0,0,32,0,0,0,0,SXF_NOCHECKPOSITION|SXF_TRANSFERPOINTERS)
		Goto XDeath
	//-------------------------		
	// BerserkKill
	Death.BerserkKill:
		TNT1 AA 0 A_SpawnItemEx("D4PinataHealth",0,0,0,frandom(-4,4),frandom(-4,4),frandom(1,5),0,SXF_NOCHECKPOSITION)
		Goto XDeath
		
	//------------------------------------------------------------------------
	// Start of Stagger / Glory Kill states
	//------------------------------------------------------------------------
	Wound:
		SPOS G 0 A_SetUserVar(user_healto,20)
		Goto WoundStagger	// see MonsterBase.AED
		
	Death.GloryKill:
		SPOS G 0
		Goto GloryKillGeneric // see MonsterBase.AED
		
	GloryEnd:	//depending on the monster, is what and how much will spawn
		TNT1 A 1 A_SpawnItemEx("GloryKillPinata",0,0,32,0,0,0,0,SXF_NOCHECKPOSITION|SXF_TRANSFERPOINTERS)
		Goto XDeath
	}
}

//================================================================================================================
//================================================================================================================
//
//	"No drops" version
//	
//================================================================================================================
//================================================================================================================

Actor D4BipedicusND : D4Bipedicus
{
	//$Angled
	//$Category "D4T Monsters (No Drops)"
	//$Color 12
	//$Title "Possessed Solider (pistol)"
	DropItem ""
}