actor bonelord : actor replaces archvile
{
	Health 700
	Gibhealth -100
	Radius 20
	Height 56
	Mass 500
	Speed 15
	PainChance 10
	Monster
	MaxTargetRange 896
	painchance "KustamKick", 256
 	Painchance "BarrelGrab", 0
	+QUICKTORETALIATE
	+FLOORCLIP
	+NOTARGET
	+noblooddecals
	+DONTCORPSE
    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
	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_TakeInventory ("PowerKickedStatus",999)
		TNT1 A 0 A_JumpIfInventory ("laughcooldown",1,"see")
		BLRD R 10 A_PlaySound ("Bonelord/laugh",CHAN_VOICE,1,0,0.4)
		BLRD SRSRSRSRSRSRSRSRSRS 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 SRSRSRSRSRSRSRSRSRS 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
		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
	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,1)//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
		TNT1 A 0 A_GiveInventory ("flinch",1)
		BLRD I 5 A_TakeInventory ("StopTargeting",99)
		TNT1 A 0 A_TakeInventory ("PowerTerrorStatus",999)
		TNT1 A 0 A_TakeInventory ("PowerKickedStatus",999)
		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
	Pain.Dazer:
    Pain.Superkick:
		TNT1 A 0
		BLRD I 5 A_TakeInventory ("StopTargeting",99)
		TNT1 A 0 A_GiveInventory ("KickDazer",1)
		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 Dazed
    Dazed:
		BLRD I 2
		BLRD I 1 A_SetAngle (angle+15)
		BLRD I 1 A_JumpIfInventory ("PowerKickedStatus",1,"Dazed")
		Goto See
	death:
		BLRD I 4 
		BLRD J 2 A_Scream
		BLRD J 1 A_NoBlocking
		BLRD JKLM 3
		BLRD N 1
		TNT1 AAAAA 0 A_SpawnItemEx ("BadSpirit",0,0,5,Random(-15,15),Random(-15,15),1,0,SXF_NOCHECKPOSITION|SXF_TRANSFERPOINTERS,90)
		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)
		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.superkick:	
		BLRD J 1 A_Scream 
		BLRD J 1 A_ScaleVelocity (0.1)
 		BLRD J 1 A_Stop
		BLRD J 1 A_NoBlocking
		TNT1 A 0 A_PlaySound ("bonelord/banish",CHAN_VOICE,1,0,0.8)
		TNT1 A 0 A_ChangeFlag ("NOCLIP",1)
		TNT1 A 0 A_ChangeFlag ("NOGRAVITY",1)
		BLRD J 1 A_FaceTarget
		TNT1 A 0 ThrustThingZ (0,80,0,1)
		TNT1 A 0 ThrustThing(angle*256/360+128, 110, 1, 0)
		TNT1 A 0 A_SpawnItemEx ("kickdeathsound")
		BLRD J 1
		BLRD K 2		

	kickfly:
		BLRD K 1 A_SpawnItemEx ("KustamParticle",random(-8,8),random(-8,8),random(-10,10),random(-120,120)/15.0,random(-130,130)/12.0,random(-110,110)/17.0,0)
		BLRD K 1 A_SpawnItemEx ("KustamParticle",random(-8,8),random(-8,8),random(-10,10),random(-120,120)/15.0,random(-130,130)/12.0,random(-110,110)/17.0,0)
		BLRD K 1 A_SpawnItemEx ("KustamParticle",random(-8,8),random(-8,8),random(-10,10),random(-120,120)/15.0,random(-130,130)/12.0,random(-110,110)/17.0,0)
		BLRD K 1 A_SpawnItemEx ("KustamParticle",random(-8,8),random(-8,8),random(-10,10),random(-120,120)/15.0,random(-130,130)/12.0,random(-110,110)/17.0,0)
		BLRD K 1 A_SpawnItemEx ("KustamParticle",random(-8,8),random(-8,8),random(-10,10),random(-120,120)/15.0,random(-130,130)/12.0,random(-110,110)/17.0,0)
		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)
		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))
		FX18 A 3
		FX18 B 2
		FX18 C 2
		FX18 D 2
		FX18 E 1
		FX18 F 1
		FX18 G 1
		stop
	death.sentinelarm:
		BLRD I 4 A_FaceTarget
		TNT1 A 0 thrustthingz (0,40,0,1)
		BLRD J 2 A_Scream
		BLRD J 1 A_NoBlocking
		BLRD K 4
		TNT1 A 0 a_nogravity
		TNT1 A 0 A_Stop
		TNT1 A 0 A_PlaySound ("Kustam/OCKill",CHAN_VOICE,1,0,0.4)
		TNT1 A 0 A_PlaySound ("Kustam/OCKill",5,1,0,0.6)
		TNT1 A 0 A_PlaySound ("Kustam/OCKill",6,1,0,0.6)
		TNT1 A 0 A_PlaySound ("Kustam/OCKill",7,1,0,0.6)
		OCKL ABCDEF 2 bright
		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 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 150
	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 ("DeadTimer",1)
		loop
	revive:
		BLRD T 6
		BLRD N 20
		BLRD T 5
		BLRD N 10
		BLRD T 4
		BLRD N 10
		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 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 1 A_SpawnItemEx ("MortarBlastFX",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION)
		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")
		TNT1 A 8
		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")
		TNT1 A 8
		stop
	spawnboners:
		TNT1 A 0
		TNT1 AA 0 A_SpawnItemEx("MinibonerSpawner",0,0,0,random(-10,10),random(-10,10),random(6,18))
		TNT1 AAAA 0 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))
		TNT1 A 8
		stop

	}
}


actor MortarBlastFX
{
	+NOBLOCKMAP
	+NOGRAVITY
	+SHADOW
	+NOTELEPORT
	+CANNOTPUSH
	+NODAMAGETHRUST
	+clientsideonly
	+bright
	RenderStyle add
	alpha 0.90
	scale 2
	States
	{
	spawn:
		TNT1 A 0
		WTFB ABCD 3 
		WTFB EFGHIJ 4 
		goto death
	death:
		TNT1 A 0
		TNT1 A 1
		stop
	}
}


actor MortarBlast : CustomInventory
{
	+inventory.alwayspickup
	+INVENTORY.AUTOACTIVATE
	states
	{
	Spawn:
		TNT1 A 0
		TNT1 A 1
		stop
	Pickup:
		TNT1 A 0 
		TNT1 A 0 A_CheckFlag ("BOSS", "NoThrust")
		TNT1 A 0 A_JumpIf(CheckClass("Bonelord", AAPTR_DEFAULT, TRUE), "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
	+NOTELEPORT
	+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}

