ACTOR D4ArmoredBipedicus : D4DoomImp replaces ArmoredFlemoidusBipedicus
{
	SeeSound "imp/sight"
	PainSound "imp/pain"
	DeathSound "imp/death"
	ActiveSound "imp/active"
	HitObituary "$OB_IMPHIT"
	Obituary "$OB_IMP"
	BloodColor "Green"	
	States
	{
	Spawn:
		TROO A 0 NODELAY A_SetUserVar(user_bigmonstersound,0)
		Goto Idle
	Idle:
		TROO A 10 A_Look
		Loop
	See:
		TROO AABBCCDD 2 A_Chase
		Loop
	Melee:
	Missile:
		TNT1 A 0 A_JumpIfCloser(1024,"FireBall")	//if too far away, will always use the big ball
		
		FireBall:
			TNT1 A 0 A_Jump(64,"FireBallhuge")	//yet, if close enough, it will still use sometimes the big ball
			TROO EE 4 Light("ImpPrepareAttackSmall") A_FaceTarget
			TROO F 6 A_CustomMissile("D4ArmoredBipedicusBall",35,5,0)
			TROO G 4
			Goto See
		FireBallhuge:
			TROO EEEEEEEEEE 4 Light("ImpPrepareAttackBig") A_FaceTarget
			TROO G 0 A_PlaySound("Doom4/Monsters/Imp/Attack",CHAN_AUTO,1.0,false,1.3)
			TROO F 6 A_CustomMissile("D4ArmoredBipedicusBallHuge",35,5,0)
			TROO G 4
			Goto See
			
	Pain:
		TROO H 2
		TROO H 2 A_Pain
		Goto See

	Death:
		"####" "#" 0  A_SpawnItemEx("SituationalPinata",0,0,32,0,0,0,0,SXF_NOCHECKPOSITION|SXF_TRANSFERPOINTERS)
		TROO N 4 
		TROO O 4 A_Scream
		TROO P 4
		TROO QRST 4 A_NoBlocking
		TROO U -1 
		Stop
		
	Raise:
		TROO TSRQPON 4
		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:
		TROO H 0 A_SetUserVar(user_healto,30)
		Goto WoundStagger	// see MonsterBase.AED
		
	Death.GloryKill:
		TROO H 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
	}
}

//Why did i have to create this? Imps are so common that 1/255 gets you still a lot of these upgrades
//So I made another imp identical, but that will not drop it. In "Spawners.AED", i declare how frequently
//this "noupgrade" imp will replace the normal version. This gives me more refined control over the drops
//for static rifle. Seriously, i'd get fully upgraded SR in the first 3 levels of Doom2
Actor D4ArmoredBipedicusNoUpgradeDrop : D4ArmoredBipedicus
{
	DropItem "DemonGrenadeDrop", 5		
}




//*********************************************
ACTOR D4ArmoredBipedicusBall : D4DoomImpBall
{
	Decal "FireballScorch"
	Translation "0:255=%[0.00,0.00,0.00]:[0.00,2.00,0.00]"
	States
	{
	Spawn:
		DB58 ABCDEFGHIJKLMNOPQRSTUVWXYZ 2 BRIGHT Light("GreenMediumFlicker3")
		Loop
	Death:
		HIBI A 0 A_SetScale(0.4)
		DB59 AB 1 BRIGHT Light("GreenSmallFlicker1")	//had to separate
		DB59 CD 1 BRIGHT Light("GreenMediumFlicker3")
		DB59 EF 1 BRIGHT Light("GreenMediumFlicker3")
		DB59 GH 1 BRIGHT Light("GreenSmallFlicker1")
		DB59 IJ 1 BRIGHT Light("GreenSmallFlicker1")
		DB59 KL 1 BRIGHT Light("GreenSmallFlicker2")
		DB59 MN 1 BRIGHT Light("GreenSmallFlicker2")
		DB59 OP 1 BRIGHT Light("GreenSmallFlicker3")
		DB59 QR 1 BRIGHT Light("GreenSmallFlicker3")
		DB59 ST 1 BRIGHT Light("GreenSmallFlicker3")
		Stop
	}
}
//*********************************************
ACTOR D4ArmoredBipedicusBallHuge : D4DoomImpBallHuge
{
	Translation "0:255=%[0.00,0.00,0.00]:[0.00,2.00,0.00]"
	Decal "FireballScorchBig"
	States
	{
	Spawn:
		DB57 ABCDEFGHIJKLMNOPQRSTUVWXYZ 1  BRIGHT Light("GreenMediumFlicker2") A_SpawnItemEx("ArmoredBipedicusBallFlamelet",random(-2,-8),random(8,-8),random(8,-8),0,0,frandom(0,0.6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERTRANSLATION,100)
		Loop
	Death:
		TNT1 A 0 A_SetScale(0.8)
		DB07 ABC 1 Bright Light("GreenMediumFlicker3")
		DB07 DEF 1 Bright Light("GreenMediumFlicker2")
		DB07 GHI 1 Bright Light("GreenMediumFlicker2")
		DB07 JKL 1 Bright Light("GreenMediumFlicker3")
		DB07 MNO 1 Bright Light("GreenSmallFlicker1")
		DB07 PQR 1 Bright Light("GreenSmallFlicker2")
		DB07 STU 1 Bright Light("GreenSmallFlicker3")
		DB07 VWX 1 Bright Light("GreenSmallFlicker3")
		Stop
	}
}

Actor ArmoredBipedicusBallFlarePrepare : DoomImpBallFlarePrepare
{
	Translation "0:255=%[0.00,0.00,0.00]:[0.00,2.00,0.00]"
}

Actor ArmoredBipedicusBallFlamelet : ImpBallFlamelet
{
	Translation "0:255=%[0.00,0.00,0.00]:[0.00,2.00,0.00]"
}





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

Actor D4ArmoredBipedicusND : D4ArmoredBipedicus
{
	//$Angled
	//$Category "D4T Monsters (No Drops)"
	//$Color 12
	//$Title "Imp"
	DropItem ""
}