//Mostly inspired to DeVloek Volacubi one - Thankx to MagicWazard for suggestions!
ACTOR Haedexebus : SSTFatso 22085
{
//$Category Monsters
//$Sprite HEDXA1
//$Title "Haedexebus"
Radius 72
Height 88
Health 750
Mass 1000
Speed 20
+FLOAT
+FLOATBOB
-FLOORCLIP
+NOGRAVITY
+MISSILEMORE
+NOINFIGHTING
+DONTHURTSPECIES
  +dontcorpse
  +forcexybillboard
SEESOUND "UNMNROAM"
PAINSOUND "UNMNPAIN"
DEATHSOUND "UNMNDYIN"
Decal "RedRailScorch"
Obituary "%o was unmade by a haedexebus."
maxtargetrange 2000
//meleerange 512
States
	{
    Crush:
	TNT1 A 0 A_SpawnItemEx ("Gibs", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
	TNT1 AAAAAAAA 0 A_SpawnItemEx ("SuperDuperClientsideBloodSpotSpawner", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
    TNT1 AAAAAAAA 1 A_SpawnItemEx ("Bloodsquirt3", 0,0,0, 0,0,0, random(-180,180), SXF_USEBLOODCOLOR|SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
    TNT1 A -1
    Stop
	Spawn:
	HEDX AABB 8 A_Look
	Loop
	See:
	HEDX AAAABBBB 4 A_Chase
	Loop
	Melee2:
	HEDX D 0 A_Jump(64,"Missile2")
	HEDX C 5 A_FatRaise
	HEDX CD 4 A_FaceTarget(90,180)
	HEDX E 0 Bright A_PlaySound("HEDXWOSH")
	HEDX E 0 BRIGHT A_CustomMissile("FatMace", 48, 32, random(-7,4))
	HEDX E 0 Bright A_PlaySound("HEDXWOSH")
	HEDX E 5 BRIGHT A_CustomMissile("FatMace", 48, -32, random(-4,7))
	HEDX CD 5 A_FaceTarget(90,180)
	Goto See
	Missile:
	HEDX C 5 A_JumpIfCloser(512,"Melee2")
	Missile2:
	HEDX C 5 A_FatRaise
	HEDX CD 5 A_FaceTarget(90,180)
	//HEDX E 0 Bright A_PlaySound("UNMNRAIL")
	HEDX E 5 BRIGHT A_CustomRailgun(random(10,20), 20, black, red, RGF_NOPIERCING, 1, 2, none, 2, 0, 2000, random(8,16), 8.0, 2.0, "FatRail", 0)
	HEDX E 5 BRIGHT A_CustomRailgun(random(10,20), -28, red, black, RGF_NOPIERCING, 1, 2, none, 2, 0, 2000, random(8,16), 8.0, 2.0, "FatRail", 0)
	HEDX CD 5 A_FaceTarget(90,180)
	//HEDX E 0 Bright A_PlaySound("UNMNRAIL")
	HEDX E 5 BRIGHT A_CustomRailgun(random(10,20), 28, black, red, RGF_NOPIERCING, 1, 2, none, 2, 0, 2000, random(8,16), 8.0, 2.0, "FatRail", 0)
	HEDX E 5 BRIGHT A_CustomRailgun(random(10,20), -20, red, black, RGF_NOPIERCING, 1, 2, none, 2, 0, 2000, random(8,16), 8.0, 2.0, "FatRail", 0)
	HEDX CD 5 A_FaceTarget(90,180)
	//HEDX E 0 Bright A_PlaySound("UNMNRAIL")
	HEDX E 5 BRIGHT A_CustomRailgun(random(10,20), 24, red, black, RGF_NOPIERCING, 1, 2, none, 2, 0, 2000, random(8,16), 8.0, 2.0, "FatRail", 0)
	HEDX E 5 BRIGHT A_CustomRailgun(random(10,20), -24, black, red, RGF_NOPIERCING, 1, 2, none, 2, 0, 2000, random(8,16), 8.0, 2.0, "FatRail", 0)
	HEDX CD 5 A_FaceTarget(90,180)
	Goto See
  Pain.Fire:
  	TNT1 AAAA 0 A_SpawnItemEx("imonfire", random(-8,-2),Random(-8,8),random(20, 38), 0, random(-30,30)*0.1, random(10,30)*0.1, 0, 160)
	Goto Pain
	Pain:
	HEDX F 4
	HEDX F 4 A_Pain
	Goto See

  Death.Chainsaw:
  Death.Shotgun:
  Death.Rocket:
  Death.Plasma:
  Death.Fire:
	Death:
	TNT1 A 0 A_ChangeFlag(FLOATBOB, 0)
	HEDX G 5 A_SetFloorClip
	NULL A 0 A_SpawnItemEx ("BloodFXSpawner", 0, 0, 0, 0, 0, 0, 0, 160) 
	HEDX H 5 A_Scream
	NULL A 0 A_SpawnItemEx ("BloodFXSpawner", 0, 0, 0, 0, 0, 0, 0, 160) 
	HEDX I 2 A_NoBlocking

  Fall:
	HEDX I 1 A_UnsetSolid
	HEDX I 0 A_changeflag("corpse",1)
	HEDX I 0 A_CheckFloor("Crash2") 
	TNT1 A 0 A_JumpIf(momz>-1 && momz<1, "Crash2")
	loop
  Crash2:
    BTO1 B 0 A_PlaySound ("hellknight/torsoland")
	HEDX JJJJ 1 A_SpawnItemEx ("SuperDuperClientsideBloodSpotSpawner", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
	HEDX KLM 4
	HEDX N -1 A_BossDeath
	Stop
	Raise:
	HEDX N 6 A_UnSetFloorClip
	HEDX MLKJIHG 6 A_SetSolid
	TNT1 A 0 A_ChangeFlag(FLOATBOB, 1)
	Goto See
	
  Pain.GreenPaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 0,0,0)
	Goto Pain
  Pain.BluePaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 1,0,0)
	Goto Pain
  Pain.RedPaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 2,0,0)
	Goto Pain
  Pain.OrangePaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 3,0,0)
	Goto Pain
  Pain.PurplePaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 4,0,0)
	Goto Pain
  Pain.WhitePaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 5,0,0)
	Goto Pain
  Pain.YellowPaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 6,0,0)
	Goto Pain
  Pain.BlackPaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 7,0,0)
	Goto Pain
	}
}

ACTOR FatRail : Blood
{
+NOGRAVITY
Mass 0
RenderStyle Translucent
Alpha 0.6
}
//Some Hellforge Cannon defs here - thankx to Eriance!
ACTOR RedPuff
{
Radius 0
Height 1
+NOGRAVITY
+NOBLOCKMAP
+FORCEXYBILLBOARD
RENDERSTYLE ADD
ALPHA 0.85
States
	{
	Spawn:
	TNT1 A 3 Bright
	RPUF ABCDE 3 Bright
	Stop
	}
}

ACTOR FatMace
{
Radius 8
Height 8
Speed 28
Damage 4
RENDERSTYLE Normal
Damagetype "rocket"//fire
PROJECTILE
//+THRUGHOST
+FORCEXYBILLBOARD
+BLOODSPLATTER
-NOGRAVITY
gravity 0.15
Seesound "grenfire"
DeathSound "weapons/rocklxNEW"
States
   {
	Spawn:
	RIP1 AABBCC 1 Bright A_SpawnItemEx("RedPuff",0,0,0,0,0,0,0,8)
    RIC2 A 0 A_Playsoundex("tracer/whoosh",CHAN_5,0)
	loop
	Death:
    MISL B 0 A_Stop
	RIC2 A 0 A_StopSoundex(CHAN_5)
	RIP1 D 0 Bright A_SetTranslucent (0.75,1)
	NULL A 0 A_SpawnItemEx ("PowEffectSpawner", 0, 0, 0, 0, 0, 0, 0, 160) 
    NULL A 0 A_SpawnItemEx ("RocketEcho", 0,0,0, 0,0,0, 0, 160)
    MISL B 0 bright A_SpawnItemEx("rocketflare", 0,0,0, 0,0,0, 0, 160)
	RIP1 D 1 Bright A_Explode(48,64,1)
	RIP1 D 0 Bright A_SpawnItemEx("FatMace2",0,0,0, 20,0,0,0,SXF_NOCHECKPOSITION|SXF_TRANSFERPOINTERS,127)
	RIP1 D 0 Bright A_SpawnItemEx("FatMace2",0,0,0, 20,0,0,60,SXF_NOCHECKPOSITION|SXF_TRANSFERPOINTERS,127)
	RIP1 D 0 Bright A_SpawnItemEx("FatMace2",0,0,0, 20,0,0,120,SXF_NOCHECKPOSITION|SXF_TRANSFERPOINTERS,127)
	RIP1 D 0 Bright A_SpawnItemEx("FatMace2",0,0,0, 20,0,0,180,SXF_NOCHECKPOSITION|SXF_TRANSFERPOINTERS,127)
	RIP1 D 0 Bright A_SpawnItemEx("FatMace2",0,0,0, 20,0,0,240,SXF_NOCHECKPOSITION|SXF_TRANSFERPOINTERS,127)
	RIP1 D 0 Bright A_SpawnItemEx("FatMace2",0,0,0, 20,0,0,300,SXF_NOCHECKPOSITION|SXF_TRANSFERPOINTERS,127)
	RIP1 DEFGH 3 Bright
	Stop
   }
}

ACTOR FatMace2
{
Radius 5
Height 5
Damage 1
PROJECTILE
RENDERSTYLE Normal
Damagetype "Fire"
+RIPPER
+BLOODSPLATTER
//+THRUGHOST
+FORCEXYBILLBOARD
+rockettrail
-nogravity
	+NODAMAGETHRUST
	
gravity 0.66
  DeathSound "imp/shotx"
States
	{
	Spawn:
	RIP2 A 3 Bright
	RIP2 B 3 Bright
    RIC2 A 0 A_Playsoundex("tracer/whoosh",CHAN_5,0)
	loop
	Death:
    MISL B 0 A_Stop
    MISL B 0 A_SpawnItemEx("redflare", 0,0,0, 0,0,0, 0, 160)
	RIP2 C 0 Bright A_SetTranslucent (0.67,1)
	NULL O 0 A_SpawnItemEx ("BurnDeathFX", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_ABSOLUTEMOMENTUM)
	RIP2 CDEDEFGFG 10 Bright A_Explode(8,64, 1)
	Stop
	}
}
