actor bonelord : actor replaces archvile
{
	Health 3200
	Gibhealth -100
	Radius 20
	Height 56
	Mass 500
	Speed 15
	PainChance 10
	Monster
	MaxTargetRange 896
	painchance "grappler", 256
	+QUICKTORETALIATE
	+FLOORCLIP
	+NOTARGET
    bloodtype bonespray
	MeleeRange 40
	SeeSound "Bonelord/sight"
	PainSound "Bonelord/pain"
	DeathSound "Bonelord/death"
	ActiveSound "Bonelord/laugh"
	Obituary "%o's bones belong to the bonelord now"
	dropitem "lilchest" 60
	dropitem "lilcube" 60
	dropitem "smallsubrefresh" 120
	States
	{
	spawn:
		TNT1 A 0 
		TNT1 A 0 a_jumpifinventory ("boneactive",1, "mock")
		BLRD AB 10 A_look
		loop
	see:
		TNT1 A 0 a_giveinventory ("boneactive",1)
		TNT1 A 0 a_takeinventory ("targetstack",99)
		TNT1 A 0 a_jumpifinventory ("chaoslaugh",1,"laugh")
		BLRD AAABBBCCCDDD 2 a_vilechase 
		TNT1 A 0 a_jumpifinventory ("chaoslaugh",1,"laugh")
		TNT1 A 0 a_takeinventory ("targetstack",99)
		loop
	laugh:
		TNT1 A 0
		TNT1 A 0 a_jumpifinventory ("laughcooldown",1,"see")
		BLRD R 10 a_playsound ("Bonelord/laugh",CHAN_VOICE,1,0,0.4)
		BLRD S 3
		BLRD R 3
		BLRD S 3
		BLRD R 3
		BLRD S 3
		BLRD R 3
		BLRD S 3
		BLRD R 3
		BLRD S 3
		BLRD R 3
		BLRD S 3
		BLRD R 3
		BLRD S 3
		BLRD R 3
		BLRD S 3
		BLRD R 3
		BLRD S 3
		TNT1 A 0 a_playsound ("bonelord/chaosrevive",CHAN_VOICE,1,0,0.5)
		TNT1 A 0 a_takeinventory ("chaoslaugh",99)
		TNT1 A 0 a_giveinventory ("laughcooldown",1)
		goto see
	Mock:
		BLRD R 10 a_playsound ("Bonelord/laugh",CHAN_VOICE,1,0,0.4)
		BLRD S 3
		BLRD R 3
		BLRD S 3
		BLRD R 3
		BLRD S 3
		BLRD R 3
		BLRD S 3
		BLRD R 3
		BLRD S 3
		BLRD R 3
		BLRD S 3
		BLRD R 3
		BLRD S 3
		BLRD R 3
		BLRD S 3
		BLRD R 3
		BLRD S 3
		BLRD A 4 a_playsound ("bonelord/revive",CHAN_VOICE,1,0,0.7)
		BLRD A 56 a_facetarget
		TNT1 A 0 a_takeinventory ("chaoslaugh",99)
		TNT1 A 0 a_takeinventory ("boneactive",99)
		TNT1 A 0 a_giveinventory ("laughcooldown",1)
		goto waiting
	waiting:
		BLRD AB 10 A_look
		loop				
	normalmove:
		TNT1 A 0 a_takeinventory ("targetstack",99)
		BLRD AAABBBCCCDDD 2 a_fastchase
		TNT1 A 0 a_takeinventory ("targetstack",99)
		TNT1 A 0 a_jumpifinventory ("dontrevive",1,"normalmove")
		goto see
	missile:
		TNT1 A 0 a_jump (80, "grappleshot")
		TNT1 A 0 a_jumpifcloser (300,"midrange")
		BLRD G 1 a_playsound ("bonelord/lockon",0,1,0,0.5)
		BLRD G 1 a_facetarget
		TNT1 A 0 a_changeflag ("NOTARGETSWITCH", 1)
		BLRD G 1 a_custommissile ("mortartracer")
	mortaraim:
		TNT1 A 0 a_jumpifinventory ("shootmortar", 1, "shootmortar")
		TNT1 A 0 a_jumpifinventory ("stoptargeting",1,"pain")
		BLRD G 1 a_facetarget
		TNT1 A 0 a_jumpifinventory ("stoptargeting",1,"pain")
		TNT1 A 0 a_jumpifinventory ("shootmortar", 1, "shootmortar")
		loop
	shootmortar:
		BLRD G 2 a_takeinventory ("shootmortar",99)
		TNT1 A 0 Radius_Quake (3,10,0,15,0)
		TNT1 A 0 a_playsound ("bonelord/mortarfire",0,1,0,0.8)
		BLRD H 6
		BLRD G 13
		goto see
	midrange:
		TNT1 A 0 a_jump (60, "grappleshot")		
		BLRD E 1 a_custommissile ("barrelfist")
		TNT1 A 0 a_playsound ("bonelord/rocketfist",6,1,0,0.6)
		BLRD E 6 a_facetarget
		BLRD E 6 a_facetarget
		BLRD E 6 a_facetarget
		BLRD E 6 
		BLRD F 6 a_custommissile ("bonefist")	
		goto see
	grappleshot:	
		BLRD E 1 a_custommissile ("barrelhand")
		TNT1 A 0 a_playsound ("bonelord/grapplearm",6,1,0,0.6)
		BLRD E 6 a_facetarget
		BLRD E 6 a_facetarget
		BLRD E 6 a_facetarget
		BLRD E 6 

		TNT1 A 0 a_custommissile ("hiddengrapple")
		TNT1 A 0 a_custommissile ("hiddengrapple")
		TNT1 A 0 a_custommissile ("hiddengrapple")
		TNT1 A 0 a_custommissile ("hiddengrapple")
		TNT1 A 0 a_playsound ("bonelord/grappleshoot",0)
		BLRD F 6 a_custommissile ("bonegrapple")
		goto see	
	melee:
		TNT1 A 0 a_playsound ("bonelord/melee",0)
		BLRD G 7 A_facetarget
		BLRD G 4 A_facetarget
		BLRD E 3
		TNT1 A 0 A_CustomMeleeAttack(random(3,10)*4,"skellytun/punch","none") //----------------This is a custom replication of the basic revenant punch damage
		TNT1 A 0 ACS_ExecuteWithResult(990,0,1,2)//flyback//------------------------------------Change arg4 for higher knockback distances. 2 is pretty big tho.
		BLRD E 3
		goto see
	heal:
		TNT1 A 0
		TNT1 A 0 a_jumpifinventory ("dontrevive",1, "normalmove")
		BLRD OPQ 5 bright
		BLRD QPO 5 Bright
		goto see
	pain:
		TNT1 A 0
		BLRD I 5 a_takeinventory ("stoptargeting",99)
		TNT1 A 0 a_giveinventory ("flinch",1)
		TNT1 A 0 a_playsound ("skeleton/allpain",0,1,0,0.5)
		BLRD I 5 a_pain
		goto see
	death:
		BLRD I 4 
		BLRD J 2 a_scream
		BLRD J 1 a_noblocking
		BLRD JKLMN 4
		TNT1 A 1 a_spawnitemex ("Lordcorpse",0,0,3)
		stop
	Xdeath:
		TNT1 A 0
		BLRD I 4 
		BLRD J 2 a_scream
		BLRD J 1 a_noblocking
		TNT1 A 0 a_playsound ("bonelord/mortarhit",6,1,0,1.2)
		TNT1 AAAAAAAAAAAAA 0 a_spawnitemex ("SkellytunSkullDeath",random(-16,16),random(-16,16),42,random(-100,100)/20.0,random(-100,100)/20.0,random(-100,100)/20.0,0)
		TNT1 AAAAAAAAA 0 a_spawnitemex("bonegib",0,0,32,random(-10,10),random(-10,10),random(5,10))
		TNT1 AAAAAA 0 a_spawnitemex("bonegib",0,0,32,random(-10,10),random(-10,10),random(5,10))
		ISKL AAAAAAA 0 a_spawnitemex("hipbonegib",0,0,32,random(-10,10),random(-10,10),10)
		ISKL AAAAA 0 a_spawnitemex("ribbonegib",0,0,32,random(-10,10),random(-10,10),12)
		TNT1 A 0 a_spawnitemex ("bonesoul",0,0,42)
		TNT1 A 5 Radius_Quake (4,10,0,50,0)
		stop
	death.sunder:
		TNT1 A 0
		BLRD I 4 
		BLRD J 2 a_scream
		BLRD J 1 a_noblocking
		TNT1 A 0 a_playsound ("bonelord/mortarhit",6,1,0,1.2)
		TNT1 AAAAAAAAAAAAA 0 a_spawnitemex ("SkellytunSkullDeath",random(-16,16),random(-16,16),42,random(-100,100)/20.0,random(-100,100)/20.0,random(-100,100)/20.0,0)
		TNT1 AAAAAAAAA 0 a_spawnitemex("bonegib",0,0,32,random(-10,10),random(-10,10),random(5,10))
		TNT1 AAAAAA 0 a_spawnitemex("bonegib",0,0,32,random(-10,10),random(-10,10),random(5,10))
		ISKL AAAAAAA 0 a_spawnitemex("hipbonegib",0,0,32,random(-10,10),random(-10,10),10)
		ISKL AAAAA 0 a_spawnitemex("ribbonegib",0,0,32,random(-10,10),random(-10,10),12)
		TNT1 A 0 a_spawnitemex ("bonesoul",0,0,42)
		TNT1 A 0 a_dropitem ("superburger",100)
		TNT1 A 5 Radius_Quake (4,10,0,50,0)
		stop
	death.slayermelee:
		BLRD I 4 
		BLRD J 2 a_scream
		BLRD J 1 a_noblocking
		BLRD JKLMN 4
		TNT1 AA 0 a_spawnitemex ("Strongsunderlootorb", 0, 0, 0, random (-4, 7), random (-6, 3), random (3,6))
		TNT1 AAA 0 a_spawnitemex ("sunderlootorb", 0, 0, 0, random (-3, 6), random (-8, 8), random (3,5))
		TNT1 A 1 a_spawnitemex ("Lordcorpse",0,0,3)
		stop
	death.slayersupermelee:	
		TNT1 A 0
		BLRD I 4 
		BLRD J 2 a_scream
		BLRD J 1 a_noblocking
		TNT1 A 0 a_playsound ("bonelord/mortarhit",6,1,0,1.2)
		TNT1 AAAAAAAAAAAAA 0 a_spawnitemex ("SkellytunSkullDeath",random(-16,16),random(-16,16),42,random(-100,100)/20.0,random(-100,100)/20.0,random(-100,100)/20.0,0)
		TNT1 AAAAAAAAA 0 a_spawnitemex("bonegib",0,0,32,random(-10,10),random(-10,10),random(5,10))
		TNT1 AAAAAA 0 a_spawnitemex("bonegib",0,0,32,random(-10,10),random(-10,10),random(5,10))
		ISKL AAAAAAA 0 a_spawnitemex("hipbonegib",0,0,32,random(-10,10),random(-10,10),10)
		ISKL AAAAA 0 a_spawnitemex("ribbonegib",0,0,32,random(-10,10),random(-10,10),12)
		TNT1 A 0 a_spawnitemex ("bonesoul",0,0,42)
		TNT1 AA 0 a_spawnitemex ("Strongsunderlootorb", 0, 0, 0, random (-4, 7), random (-6, 3), random (3,6))
		TNT1 AAA 0 a_spawnitemex ("sunderlootorb", 0, 0, 0, random (-3, 6), random (-8, 8), random (3,5))
		TNT1 A 5 Radius_Quake (4,10,0,50,0)
		stop
	death.blazice:
		BLRD I 2 a_scream
		BLIC A 2 A_noblocking
		TNT1 A 0 a_playsound ("swordtech/freezedeath")
		TNT1 A 0 a_fadeout (0.20)
		TNT1 AAAAAAAAAAAA 0 a_spawnitemex ("iceparticle",random(-8,8),random(-8,8),32,random(-100,100)/10.0,random(-100,100)/10.0,random(-100,100)/20.0,0,160)
		BLIC B 90 bright
		BLIC C 2 bright
		TNT1 A 0 a_playsound ("swordtech/iceshatter")
		TNT1 A 0 A_CustomMissile("icicle", 30,0, 0, CMF_AIMDIRECTION | CMF_TRACKOWNER)
		TNT1 A 0 A_CustomMissile("icicle", 30,0, 45, CMF_AIMDIRECTION | CMF_TRACKOWNER)
		TNT1 A 0 A_CustomMissile("icicle", 30,0, 90, CMF_AIMDIRECTION | CMF_TRACKOWNER)
		TNT1 A 0 A_CustomMissile("icicle", 30,0, 180, CMF_AIMDIRECTION | CMF_TRACKOWNER)
		TNT1 A 0 A_CustomMissile("icicle", 30,0, 270, CMF_AIMDIRECTION | CMF_TRACKOWNER)
		TNT1 A 0 A_CustomMissile("icicle", 30,0, 360, CMF_AIMDIRECTION | CMF_TRACKOWNER)
		TNT1 AAAAAAAA 0 a_dropitem ("treatspawner",1,140)
		TNT1 AAA 0 a_spawnitemex ("icefragment",0,0,0,random(-10,10),random(-10,10),10) 
		TNT1 AAAA 0 a_spawnitemex ("icefragment",0,0,0,random(-4,13),random(-8,13),8) 
		stop
	death.fatalslash:
		BLRD I 2 a_scream
		BLIC A 4 a_noblocking
		BLRD I 15 
	randomwait:
		FDBL A 1 a_jump (20,"split")
		loop
	split:
		FDBL AABBCC 5
		FDBL DE 2 
		FDBL FGHIJ 3 bright  A_SpawnItemEx ("fatalburst", frandom(-20,20),frandom(-20,20),frandom(5,30), 0,0,0, 0, SXF_NOCHECKPOSITION,80)
		FDBL JJJJJ 1 bright  A_SpawnItemEx ("fatalburst", frandom(-20,20),frandom(-20,20),frandom(5,30), 0,0,0, 0, SXF_NOCHECKPOSITION,80)
	exploding:
		FDBL J 1 bright 
		TNT1 A 1 bright A_SpawnItemEx ("fatalburst", frandom(-20,20),frandom(-20,20),frandom(5,30), 0,0,0, 0, SXF_NOCHECKPOSITION, 80)
		FDBL J 1 bright 
		TNT1 A 1 bright A_SpawnItemEx ("fatalburst", frandom(-20,20),frandom(-20,20),frandom(5,30), 0,0,0, 0, SXF_NOCHECKPOSITION, 80)
		FDBL J 1 bright 
		TNT1 A 1 bright A_SpawnItemEx ("fatalburst", frandom(-20,20),frandom(-20,20),frandom(5,30), 0,0,0, 0, SXF_NOCHECKPOSITION, 80)
		FDBL J 1 bright a_jump (100,"reallydie")
		TNT1 A 1 bright A_SpawnItemEx ("fatalburst", frandom(-20,20),frandom(-20,20),frandom(5,30), 0,0,0, 0, SXF_NOCHECKPOSITION, 80)
		loop
	reallydie:
		TNT1 A 0
		TNT1 A 1 a_spawnitemex ("fataldrawdeath",0,0,30)
		stop
	}
}

actor lordcorpse
{
	Monster
	Health 320
	Radius 20
	Height 45
	Mass 6000
	+dontoverlap
	+thruspecies
	+bright
	-solid
	-floorclip
	-countkill
	+bright
    bloodtype bonespray
	states
	{
	spawn:
		TNT1 A 0
		BLRD N 2 a_jumpifinventory ("Deadtimer",100, "revive")
		TNT1 AAA 0 a_spawnitemex ("missiledebris2",random(-10,10),random(-8,8),random(1,5),random(-100,100)/15.0,random(-100,100)/20.0,random(-100,100)/20.0,0)
		TNT1 A 0 a_giveinventory ("HighstunCD",1)
		TNT1 A 0 a_giveinventory ("DeadTimer",1)
		loop
	revive:
		BLRD T 6
		TNT1 A 0 a_giveinventory ("HighstunCD",1)
		BLRD N 20
		BLRD T 5
		BLRD N 10
		BLRD T 4
		BLRD N 10
		TNT1 A 0 a_giveinventory ("HighstunCD",1)
		BLRD T 3
		BLRD N 5
		BLRD T 2
		BLRD N 2
		TNT1 A 0 a_playsound ("vile/raise",0,1,0,0.9)
		BLRD NMLKJ 5
		TNT1 A 0 a_takeinventory ("Deadtimer",999)
		BLRD A 1 a_facetarget
		BLRD A 60 a_playsound ("bonelord/revive",0)
		TNT1 A 0 a_spawnitemex ("Activebonelord")
		stop
	Death:
		TNT1 A 0
		TNT1 A 0 a_scream
		TNT1 A 0 a_playsound ("bonelord/explode",6,1,0,0.6)
		TNT1 AAAAAAAAAAAAA 0 a_spawnitemex ("SkellytunSkullDeath",random(-16,16),random(-16,16),42,random(-100,100)/20.0,random(-100,100)/20.0,random(-100,100)/20.0,0)
		TNT1 AAAAAAAAA 0 a_spawnitemex("bonegib",0,0,32,random(-10,10),random(-10,10),random(5,10))
		TNT1 AAAAAA 0 a_spawnitemex("bonegib",0,0,32,random(-10,10),random(-10,10),random(5,10))
		ISKL AAAAAAA 0 a_spawnitemex("hipbonegib",0,0,32,random(-10,10),random(-10,10),10)
		ISKL AAAAA 0 a_spawnitemex("ribbonegib",0,0,32,random(-10,10),random(-10,10),12)
		TNT1 AAAAAA 0 a_spawndebris ("missiledebris1")
		TNT1 AAAAAAAAAAA 0 a_spawnitemex ("missiledebris2",random(-26,26),random(-20,20),random(-10,10),random(-150,150)/15.0,random(-100,100)/20.0,random(-100,100)/20.0,0)
		TNT1 AAAAAAAAAAA 0 a_spawnitemex ("missiledebris2",random(-26,26),random(-20,20),random(-10,10),random(-150,150)/15.0,random(-100,100)/20.0,random(-100,100)/20.0,0)
		TNT1 A 0 Radius_Quake (2,10,0,20,0)
		FX18 A 3
		FX18 B 2
		FX18 C 2
		FX18 D 2
		FX18 E 1
		FX18 F 1
		FX18 G 1
		stop
	}
}

actor activebonelord : Bonelord
{
	+lookallaround
	states
	{
	spawn:
		TNT1 A 0
		TNT1 A 0 a_jumpifinventory ("boneactive",1, "mock")
		BLRD A 1 a_look
		Goto see
	}
}


actor bonegrapple : loreshot
{
	+notimefreeze
	Radius 18
	Height 10
	Speed 30
	damagetype grappler
	Damage (5) //Won't pull at zero damage.
	Projectile
	-NoBlockMap
	+NoIceDeath
	+DontGib
	+bright
	+THRUGHOST
	+thruspecies
	species "enemyshot"
	scale 1
	RenderStyle Normal
	seesound "grappler/shoot"
	States
	{
	Spawn:
		GHND A 1 a_spawnitem ("grapplechain")
		LINK A 0 a_spawnitem ("grapplechain")
		LINK A 0 a_spawnitem ("grapplechain")
		LINK A 0 a_spawnitem ("grapplechain")
		LINK A 0 a_spawnitem ("grapplechain")
		loop
	Death:
	crash:
		TNT1 A 0
		TNT1 A 0 A_SpawnItemEx("SkellytunSkullDeath")
		TNT1 AAA 0 a_spawnitemex("bonegib",0,0,0,random(-10,10),random(-10,10),random(3,10))
		TNT1 A 1
		stop
	XDeath:
		TNT1 A 0
		TNT1 A 0 a_playsound ("bonelord/grapplehit",0)
		GHND A 2
		Stop
	}
}

actor bonefist
{
	+notimefreeze
	projectile
	species "enemyshot"
	+FORCEXYBILLBOARD
	+thruspecies
	+LOOKALLAROUND
	+THRUGHOST
	height 12
	radius 5
	speed 20
	damage (30)
	projectilekickback 3000
	scale 1
	seesound "magegunner/missileshot"
	deathsound "magegunner/missileexplode"
	states
	{
	spawn:
		GHND D 1
		loop
	death:
		TNT1 A 0
		TNT1 A 0 A_SpawnItemEx("SkellytunSkullDeath")
		TNT1 AAAAAAAAA 0 a_spawnitemex("blackbones",0,0,32,random(-20,15),random(-8,16),random(5,10))
		TNT1 A 1
		stop
	Xdeath:
		TNT1 A 0
		TNT1 A 0 A_SpawnItemEx("SkellytunSkullDeath")
		TNT1 A 0 a_playsound ("skellytun/punch",6)
		TNT1 AAAAAAAAA 0 a_spawnitemex("blackbones",0,0,32,random(-20,15),random(-8,16),random(5,10))
		TNT1 A 1
		stop
	}
}


actor barrelhand
{
	scale 0.8
	projectile
	+clientsideonly
	+noclip
	+dontblast
	states
	{
	spawn:
		TNT1 A 0
		GHND BBB 1 a_warp (AAPTR_TARGET,45,0,47,0,WARPF_INTERPOLATE)
		GHND AAAAAAAAAAAAAAAAAAAAAAAA 1 a_warp (AAPTR_TARGET,45,0,47,0,WARPF_INTERPOLATE)
		stop
	death:
		TNT1 A 1 
		stop
	}
}

actor barrelfist
{
	scale 0.8
	projectile
	+clientsideonly
	+noclip
	+dontblast
	states
	{
	spawn:
		TNT1 A 0
		GHND CCCCCCCCCCCCCC 1 a_warp (AAPTR_TARGET,45,0,47,0,WARPF_INTERPOLATE)
		TNT1 A 0 a_playsound ("bonelord/knuckle",CHAN_BODY,1,0,0.6)
		GHND DDDDDDDDDDDDD 1 a_warp (AAPTR_TARGET,45,0,47,0,WARPF_INTERPOLATE)
		stop
	death:
		TNT1 A 1 
		stop
	}
}

actor hiddengrapple : bonegrapple
{
	states
	{
	spawn:
		TNT1 A 1
		loop
	}
}

actor mortartracer
{
	projectile
	renderstyle add
	alpha 0.80
	+SEEKERMISSILE
	+NOCLIP
	+THRUACTORS
	seesound "Bonelord/tracking"
	speed 1
	states
	{
	spawn:
		TNT1 A 0
		TNT1 A 0 a_jumpifinventory ("flinch",1,"canceltarget",AAPTR_TARGET)
		TNT1 A 1 a_warp (AAPTR_TRACER,10,0,32,0,WARPF_NOCHECKPOSITION|WARPF_INTERPOLATE)
		TNT1 A 0 a_jumpifinventory ("flinch",1,"canceltarget",AAPTR_TARGET)
		TNT1 A 0 a_spawnitemex ("trackcursor")
		TNT1 A 0 a_giveinventory ("targetstack",1)
		TNT1 A 0 a_jumpifinventory ("targetstack", 60, "launchmortar")
		TNT1 A 0 a_jumpiftargetinlos ("spawn",0)
		goto death
	death:
		TNT1 A 0
		TNT1 A 0 a_stopsound(CHAN_VOICE)
		TNT1 A 1 a_giveinventory ("stoptargeting",1,AAPTR_TARGET)
		stop
	canceltarget:
		TNT1 A 0
		TNT1 A 0 a_stopsound(CHAN_VOICE)
		TNT1 A 1
		stop		
	Launchmortar:
		TNT1 A 0 a_stop
		TNT1 A 0 a_stopsound (CHAN_VOICE)
		TNT1 A 0 a_playsound ("bonelord/confirmtarget",0,1,0,0.5)
		BLCS B 2 a_stop
		TNT1 A 2 a_jumpifinventory ("flinch",1,"canceltarget",AAPTR_TARGET)
		BLCS B 2 a_jumpifinventory ("flinch",1,"canceltarget",AAPTR_TARGET)
		TNT1 A 2 a_jumpifinventory ("flinch",1,"canceltarget",AAPTR_TARGET)
		BLCS B 2 a_jumpifinventory ("flinch",1,"canceltarget",AAPTR_TARGET)
		TNT1 A 2 a_jumpifinventory ("flinch",1,"canceltarget",AAPTR_TARGET)
		BLCS B 2 a_jumpifinventory ("flinch",1,"canceltarget",AAPTR_TARGET)
		TNT1 A 2 a_jumpifinventory ("flinch",1,"canceltarget",AAPTR_TARGET)
		TNT1 A 0 a_giveinventory ("shootmortar",1,AAPTR_TARGET)
		BLCS B 5
		TNT1 A 0 a_spawnitemex ("bonemortar",2,0,200)		
		BLCS B 15
		stop
	}
}


actor trackcursor
{
	renderstyle add
	alpha 0.60
	projectile
	+clientsideonly
	+noclip
	+dontblast
	+bright
	scale 1
	states
	{
	spawn:
		TNT1 A 0
		BLCS A 1
		stop
	}
}


actor bonemortar 
{
	alpha 0.90
	scale 2
    Radius 7
    Height 6
    Speed 0
	damage (30)
    PROJECTILE
	+NOCLIP
	+BRIGHT
    States
	{
	spawn:
		TNT1 A 0 A_JumpIf(floorz == z, "death")
		BLMR A 1 thrustthingz (0,30,1,1)
		TNT1 A 0 A_JumpIf(floorz == z, "death")
		Loop
	death:
		TNT1 A 0
		TNT1 A 0
		TNT1 A 0 a_jump (30,"Stockboom")
		TNT1 A 0 a_playsound ("bonelord/mortarhit",0,1,0,0.8)
		TNT1 A 0 a_explode (40, 250, 0, 0, 100)
		TNT1 A 0 Radius_Quake (5,20,0,50,0)
		TNT1 A 0 A_RadiusGive ("MortarBlast", 200, RGF_PLAYERS|RGF_MONSTERS, 1)
		TNT1 A 0 A_RadiusThrust(1200,220,0,100)
		TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("BonerCounter",0,0,0) == 1,"SpawnBoners")
		WTFB ABCD 3 
		WTFB EFGHIJ 4 
		stop
	stockboom:
		TNT1 A 0
		TNT1 A 0 a_playsound ("Treeboom",0,1,0,0.9)
		TNT1 A 0 a_explode (40, 250, 0, 0, 100)
		TNT1 A 0 Radius_Quake (5,20,0,50,0)
		TNT1 A 0 A_RadiusGive ("MortarBlast", 200, RGF_PLAYERS|RGF_MONSTERS, 1)
		TNT1 A 0 A_RadiusThrust(1200,220,0,100)
		TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("BonerCounter",0,0,0) == 1,"SpawnBoners")
		WTFB ABCD 3 
		WTFB EFGHIJ 4 
		stop
	spawnboners:
		TNT1 A 0
		TNT1 AA 0 a_spawnitemex("MinibonerSpawner",0,0,0,random(-10,10),random(-10,10),random(6,18))
		WTFB ABCD 3 a_spawnitemex("MinibonerSpawner",0,0,0,random(-15,13),random(-12,16),random(9,13))
		TNT1 A 0 a_spawnitemex("MinibonerSpawner",0,0,0,random(-13,7),random(-13,14),random(8,14))
		WTFB EFGHIJ 4 
		stop

	}
}

actor MortarBlast : CustomInventory
{
	states
	{
	Spawn:
		TNT1 A 0
		TNT1 A 1
		stop
	Pickup:
		TNT1 A 0 
		TNT1 A 0 A_CheckFlag ("BOSS", "NoThrust")
		TNT1 A 0 ThrustThingZ(0,60,0,0)
		stop
	NoThrust:
		TNT1 A 0 
		stop
	}
}


actor bonesoul
{
	renderstyle add
	alpha 0.60
	+clientsideonly
	+nogravity
	+noclip
	+dontblast
	+bright
	scale 2
	states
	{
	spawn:
		TNT1 A 0
		TNT1 A 0 a_playsound ("bonelord/banish",CHAN_VOICE,1,0,0.8)
		BLSL ABCD 4
		BLSL ABCD 3
		BLSL ABCDEFGH 3
		BLSL IJ 5
		BLSL IJ 4
		BLSL IJ 2
		TNT1 A 0 a_stopsound (CHAN_VOICE)
		TNT1 A 0 a_playsound ("bonelord/explode",0,1,0,0.6)
		TNT1 AAAAAAAAA 0 a_spawndebris ("missiledebris1")
		TNT1 AAAAAAAAAAAAAAA 0 a_spawnitemex ("missiledebris2",random(-26,26),random(-20,20),random(-10,10),random(-150,150)/15.0,random(-100,100)/20.0,random(-100,100)/20.0,0)
		TNT1 AAAAAAAAAAAAAAA 0 a_spawnitemex ("missiledebris2",random(-26,26),random(-20,20),random(-10,10),random(-150,150)/15.0,random(-100,100)/20.0,random(-100,100)/20.0,0)
		TNT1 A 0 Radius_Quake (4,12,0,50,0)
		FX18 A 3
		FX18 B 2
		FX18 C 2
		FX18 D 2
		FX18 E 1
		FX18 F 1
		FX18 G 1
		stop
	}
}


//===BONELORD TOKENS===
actor flinch : Powerup
{
  Powerup.Duration 5
}

actor dontrevive : powerup
{
  Powerup.Duration 5
}

actor chaoslaugh : powerup
{
  Powerup.Duration 60
}

actor laughcooldown : powerup
{
  Powerup.Duration 6
}


actor shootmortar : inventory
{inventory.maxamount 1}	

actor stoptargeting : inventory
{inventory.maxamount 1}	

actor targetstack : inventory
{inventory.maxamount 60}

actor DeadTimer : inventory
{inventory.maxamount 100}

