ACTOR BomberLord : BomberKnight
{
	speed 14
	PainChance 80
	HitObituary "%o was brought down low by a bomber lord"
	Obituary "%o was blasted to rubble by a bomber lord"
	dropitem "lilchest" 35
	translation "80:104=160:167", "105:111=33:47", "112:127=168:182"
	states
	{
	Missile:
		TNT1 A 0
        TNT1 A 0 A_JumpIfCloser(200, "shortbombthrow" )
		BMKN EF 6 A_FaceTarget
		BMKN G 6 a_custommissile ("longlordbomb",40)
		goto see
	Death:
		BMKN L 6 a_facetarget
		BMKN M 3 A_Scream
		BMKN M 1 a_spawnitemex("leftlordbracer",0,0,20,random(-10,10),random(-10,10),random(10,18))		
		BMKN M 1 a_spawnitemex("rightlordbracer",0,0,20,random(-10,10),random(-10,10),random(10,18))		
		BMKN M 1 a_spawnitemex("leftlordpauldron",0,0,40,random(-10,10),random(-10,10),random(10,18))		
		BMKN M 1 a_spawnitemex("rightlordpauldron",0,0,40,random(-10,10),random(-10,10),random(10,18))		
		BMKN M 1 a_spawnitemex("lordhelmet",0,0,50,random(-10,10),random(-10,10),random(10,18))
		BMKN N 4 A_NoBlocking
		BMKN O 3 
		BMKN P 3 a_playsound ("bomberknight/fall",CHAN_BODY)
		TNT1 A 0 a_spawnitemex ("MartyrBomb",0,0,10,frandom(-8,-3), frandom(-8,-3), frandom(3,8))
		BMKN Q 1 
		TNT1 A 0 a_jump (15,"DarkPortal")
		BMKN Q -1
		Stop
	DarkPortal:
		TNT1 A 0
		BMKN Q random(50,180)  
		TNT1 A 0 a_playsound ("Darkportal/form",0)
		BMKN Q 3 Thing_SetTranslation(0, 4242)
		HWRP ABCD 1
		TNT1 A 1 a_spawnitemex ("MediumPortal")
		stop		
	Xdeath:
		BMKN L 1 A_Scream
		BMKN L 4 a_facetarget
		BMKN M 2 a_noblocking
		TNT1 A 0 Radius_Quake (2,10,0,32,0)
		TNT1 A 0 a_playsound ("bomberknight/explosion",CHAN_VOICE,1,0,0.50)
		TNT1 A 0 a_playsound ("skeleton/gib",0,1,0,0.6)
		BMKN M 0 a_spawnitemex("leftlordbracer",0,0,20,random(-20,20),random(-20,20),random(18,26))		
		BMKN M 0 a_spawnitemex("rightlordbracer",0,0,20,random(-20,20),random(-20,20),random(18,26))		
		BMKN M 0 a_spawnitemex("leftlordpauldron",0,0,40,random(-20,20),random(-20,20),random(18,26))		
		BMKN M 0 a_spawnitemex("rightlordpauldron",0,0,40,random(-20,20),random(-20,20),random(18,26))		
		BMKN M 0 a_spawnitemex("lordhelmet",0,0,50,random(-10,10),random(-10,10),random(10,18))
		TNT1 AAAAAAAAAAA 0 a_spawnitemex ("Knightbloodsplatter",0,0,34)       
		TNT1 AAAAAAAA 0 a_spawnitemex("bonegib",0,0,0,random(-15,10),random(-10,10),random(5,10))
		TNT1 AAA 0 a_spawnitemex("bonegib",0,0,0,random(-15,15),random(-17,19),random(5,10))
		ISKL AAAAA 0 a_spawnitemex("hipbonegib",0,0,0,random(-16,14),random(-16,19),10)
		ISKL AAAAAAA 0 a_spawnitemex("ribbonegib",0,0,0,random(-15,14),random(-18,14),12)
		TNT1 A 1 a_spawnitemex ("KnightSplosion")
		TNT1 A 0 thrustthingz (0,60,0,1)
		TNT1 A 0 ThrustThing(angle*256/360+128, 5, 0, 0)
		TNT1 A 6
	Skullflying:
		BMKN R 1
		TNT1 A 0 A_JumpIf(Abs(VelZ) <= 0.01, "SkulDed")
		BMKN R 1
		TNT1 A 0 A_JumpIf(Abs(VelZ) <= 0.01, "SkulDed")
		BMKN S 1
		TNT1 A 0 A_JumpIf(Abs(VelZ) <= 0.01, "SkulDed")
		BMKN S 1
		TNT1 A 0 A_JumpIf(Abs(VelZ) <= 0.01, "SkulDed")
		BMKN T 1
		TNT1 A 0 A_JumpIf(Abs(VelZ) <= 0.01, "SkulDed")
		BMKN T 1
		TNT1 A 0 A_JumpIf(Abs(VelZ) <= 0.01, "SkulDed")
		BMKN U 1
		TNT1 A 0 A_JumpIf(Abs(VelZ) <= 0.01, "SkulDed")
		BMKN U 1
		TNT1 A 0 A_JumpIf(Abs(VelZ) <= 0.01, "SkulDed")
		loop
	SkulDed:
		BMKN R 1 a_playsound ("gibs/bones",0)
		TNT1 A 0 thrustthingz (0,20,0,0)
		BMKN STUR 2
		TNT1 A 0 a_jump (15,"GibbedDarkPortal")
		BMKN R -1
		stop
	GibbedDarkPortal:
		TNT1 A 0
		BMKN R random(50,180) 
		TNT1 A 0 a_playsound ("Darkportal/form",0)
		BMKN R 3 Thing_SetTranslation(0, 4242)
		HWRP ABCD 1
		TNT1 A 1 a_spawnitemex ("MediumPortal")
		stop		
	}
}



actor longlordbomb
{
    +notimefreeze
	+FORCEXYBILLBOARD	
	+THRUSPECIES
	+THRUGHOST
	+bright
	species "Bombknight"
	Radius 6
	Height 15
	Speed 18
	Damage (25)
	Projectile
	states
	{
	spawn:
		TNT1 A 0 
		TNT1 A 0 a_playsound ("bomberknight/throw", CHAN_VOICE,1,0,0.60)
		KNBM C 1 
	flight:
		KNBM CDEF 2
		loop
	Xdeath:
		TNT1 A 0 a_stop
		TNT1 A 0 a_playsound ("bomberknight/explosion",0,1,0,0.50)
		TNT1 A 0 radius_quake (1,10,0,20,0)
		TNT1 A 0 a_explode (15,150,0,0,100)
		KBXP ABCDEFGHIJKLMNOP 2 bright
		stop
	death:
	crash:
		TNT1 A 0
		TNT1 A 0 a_playsound ("bomberknight/bombbounce",0)
		TNT1 A 1 a_spawnitemex ("longbombwall",-5,0,0,frandom(-8,-3), frandom(-8,-3), frandom(3,8))
		stop
	}
}

actor longbombwall
{
	+notimefreeze
	+bloodlessimpact
	+dontrip
	+shootable
	+bright
	-noblockmap
	-nogravity
	+noblooddecals
	+FORCEXYBILLBOARD	
	+THRUSPECIES
	+THRUGHOST
	+dontblast
	bloodtype nullblood
	species "bombknight"
	Gravity 0.80
	health 100
	mass 99999
	Radius 25
	height 40
	states
	{
	spawn:
		TNT1 A 0
		TNT1 A 0 a_giveinventory ("bombtimer", 1)
		KNBM A 1 a_jumpifinventory ("bombtimer", 40, "preexplode")
		loop
	preexplode:
		TNT1 A 0 a_scalevelocity (0.50)
		KNBM A 10 
		KNBM B 3 bright
		TNT1 A 0 a_scalevelocity (0.50)
		KNBM A 3 
		KNBM B 3 bright 
		KNBM A 3 
		KNBM B 3 bright 
		KNBM A 3 
		KNBM B 3 bright 
		goto boom
	boom:
		TNT1 A 0
		TNT1 A 0 a_unsetshootable
		TNT1 A 0 a_stop
		TNT1 A 0 a_changeflag ("nogravity", 1)
		TNT1 A 0 a_playsound ("bomberknight/explosion",CHAN_VOICE,1,0,0.50)
		TNT1 A 0 radius_quake (2,10,0,20,0)
		TNT1 A 0 a_explode (10,90,1,0,20)
		TNT1 A 0 a_stop
		KBXP ABCDEFGHIJKLMNOP 2 bright
		stop
	death:
		TNT1 A 0
		KBDU ABCDEFGHIJKL 2 bright
		stop
	}
}


actor martyrbomb
{
	+notimefreeze
	+bloodlessimpact
	+dontrip
	+shootable
	+bright
	-noblockmap
	-nogravity
	+noblooddecals
	+FORCEXYBILLBOARD	
	+THRUSPECIES
	+THRUGHOST
	+dontblast
	bloodtype nullblood
	health 300
	radius 20
	height 40
	mass 2000
	scale 2
	states
	{
	spawn:
		KNBM A 40
		KNBM B 3 bright
		KNBM A 3
		KNBM B 3 bright
		KNBM A 3
		KNBM B 3 bright
		KNBM A 3
		KNBM B 3 bright
		goto explosion
	Death:
		TNT1 A 0
		KBDU ABCDEFGHIJKL 2 bright
		stop		
	Explosion:
		TNT1 A 0 a_unsetshootable
		TNT1 A 0 a_changeflag ("nogravity", 1)
		TNT1 A 0 a_playsound ("bomberknight/explosion",CHAN_VOICE,1,0,0.50)
		TNT1 A 0 radius_quake (2,10,0,20,0)
		TNT1 A 0 a_radiusthrust (2000,150)
		TNT1 A 0 a_explode (35,200,1,0,90)
		KBXP ABCDEFGHIJKLMNOP 2 bright
		stop
	}
}





//Bomber lord armor chunks
actor lordhelmet
{
	+notimefreeze
	+cannotpush
	+movewithsector
	+dontsplash
	+noblockmap
	+missile
	+doombounce
	+thruactors
	-nogravity
	+FORCEXYBILLBOARD	
	+LOOKALLAROUND
	+bounceonactors
	+NOTELEPORT
	scale 1
	Gravity 1.5 
	bouncecount 3
    bouncefactor 0.45
	Speed 5
	translation "80:104=160:167", "105:111=33:47", "112:127=168:182"
    States
	{
	spawn:
		KNHM ABCD 3
		loop
	death:
		KNHM A 400
		KNHM A 10 a_fadeout (0.25)
		KNHM A 10 a_fadeout (0.25)
		KNHM A 10 a_fadeout (0.25)
		KNHM A 10 a_fadeout (0.25)
		stop
	}
}

actor leftlordpauldron : lordhelmet
{
	states
	{
	spawn:
		LPLD ABCD 3
		loop
	death:
		LPLD A 400
		LPLD A 10 a_fadeout (0.25)
		LPLD A 10 a_fadeout (0.25)
		LPLD A 10 a_fadeout (0.25)
		LPLD A 10 a_fadeout (0.25)
		stop
	}
}

actor rightlordpauldron : lordhelmet
{
	states
	{
	spawn:
		RPLD ABCD 3
		loop
	death:
		RPLD A 400
		RPLD A 10 a_fadeout (0.25)
		RPLD A 10 a_fadeout (0.25)
		RPLD A 10 a_fadeout (0.25)
		RPLD A 10 a_fadeout (0.25)
		stop
	}
}

actor rightlordbracer : lordhelmet
{
	states
	{
	spawn:
		RBRC ABCD 3
		loop
	death:
		RBRC A 400
		RBRC A 10 a_fadeout (0.25)
		RBRC A 10 a_fadeout (0.25)
		RBRC A 10 a_fadeout (0.25)
		RBRC A 10 a_fadeout (0.25)
		stop
	}
}

actor leftlordbracer : lordhelmet
{
	states
	{
	spawn:
		LBRC ABCD 3
		loop
	death:
		LBRC A 400
		LBRC A 10 a_fadeout (0.25)
		LBRC A 10 a_fadeout (0.25)
		LBRC A 10 a_fadeout (0.25)
		LBRC A 10 a_fadeout (0.25)
		stop
	}
}
