//////////////////////
// HERETIC D'SPARIL //
//////////////////////

ACTOR D'Sparil : Sorcerer2 replaces Sorcerer2
{
states
{
  Missile:
    TNT1 A 0 
	TNT1 A 0 A_FaceTarget
    TNT1 AAA 0 A_SpawnItemEx("DsparilChargeFlare", random(-32,32),random(-32,32),0,0,0,random(5,10))
    SOR2 R 9 BRIGHT A_Srcr2Decide
	TNT1 AAA 0 A_SpawnItemEx("DsparilChargeFlare", random(-32,32),random(-32,32),0,0,0,random(5,10))
    SOR2 S 9 BRIGHT A_FaceTarget
	TNT1 AAAAAA 0 A_SpawnItemEx("DsparilChargeFlare2", random(-32,32),random(-32,32),0,0,0,random(5,10))
    SOR2 T 20 BRIGHT A_Srcr2Attack
    Goto See
  Death:
    SDTH A 8 A_Sor2DthInit
    SDTH B 8 A_Stop
    SDTH C 8 A_PlaySoundEx("dsparil/scream", "Body")
  DeathLoop:
    SDTH D 7 BRIGHT
	TNT1 AAAAA 0 A_SpawnItemEx("DsparilChargeFlare", random(-64,64),random(-64,64),0,0,0,random(5,10))
	SDTH E 7 BRIGHT
	TNT1 AA 0 A_SpawnItemEx("DsparilChargeFlare", random(-64,64),random(-64,64),0,0,0,random(5,10))
    SDTH F 7 BRIGHT A_Sor2DthLoop
	TNT1 AAAA 0 A_SpawnItemEx("DsparilChargeFlare", random(-64,64),random(-64,64),0,0,0,random(5,10))
	TNT1 A 0 
	TNT1 AAAAAAAAAAA 0 A_SpawnItemEx("DsparilChargeFlare2", random(-64,64),random(-64,64),0,0,0,random(5,10))
    SDTH G 6 BRIGHT A_PlaySoundEx("dsparil/explode", "Body")
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("DSparilBoomFlare", 0, 0, 48, (0.1)*Random(100, 400), 0, (0.1)*Random(-400, 400), Random(0, 720), 128)
	TNT1 AAAAAAAAA 0 A_SpawnItemEx("DSparilBoomFlare2", 0, 0, 48, (0.1)*Random(100, 400), 0, (0.1)*Random(-400, 400), Random(0, 720), 128)
    SDTH H 6 
    SDTH I 18 
    SDTH J 6 A_NoBlocking
    SDTH K 6 A_PlaySoundEx("dsparil/bones", "Body")
    SDTH LMN 6 
    SDTH O -1 A_BossDeath
    Loop
  }
}

//-----
ACTOR D'SparilAttack : Sorcerer2FX1 replaces Sorcerer2FX1
{
  States
  {
  Spawn:
    FX16 AA 3 BRIGHT A_SpawnItemEx("DSAttackTrail", Random(-7, 7), Random(-7, 7), Random(0, 9), Random(1, 3), 0, (0.1)*Random(-10, 10), Random(-20, 20), 128)
	FX16 BB 3 BRIGHT A_SpawnItemEx("DSAttackTrail2", Random(-7, 7), Random(-7, 7), Random(0, 9), Random(1, 3), 0, (0.1)*Random(-10, 10), Random(-20, 20), 128)
    FX16 CC 3 BRIGHT A_SpawnItemEx("DSAttackTrail", Random(-7, 7), Random(-7, 7), Random(0, 9), Random(1, 3), 0, (0.1)*Random(-10, 10), Random(-20, 20), 128)
	Loop
  Death:
    FX16 A 0 A_SpawnItem("DSAttackFlash")
    FX16 AAAAAAAAAAAAA 0 A_SpawnItemEx("DSparilBoltFlare", 0, 0, 4, (0.1)*Random(25, 75), 0, (0.1)*Random(-25, 25), Random(0, 360), 128)
	FX16 AAAAAAAAAAAAA 0 A_SpawnItemEx("DSparilBoltFlare2", 0, 0, 4, (0.1)*Random(25, 75), 0, (0.1)*Random(-35, 35), Random(0, 360), 128)
    FX16 G 5 BRIGHT A_Explode(random[S2FX1](80,111))
    FX16 HIJKL 5 BRIGHT
	stop 
  }
}

ACTOR DSAttackFlash : Baseflare
{
   Scale 0.5
   alpha 1
   +BRIGHT
   States
   {
   Spawn:
	GLIT B 1 BRIGHT A_FadeOut
	Loop
   }
}

Actor DSAttackTrail
{
  Height 0
  Radius 0
  Mass 0
  +MISSILE
  +NOBLOCKMAP
  +NOGRAVITY
  +DONTSPLASH
  RenderStyle Add
  Alpha 1
  Scale 0.025
  States
  {
  Spawn:
    GLIT B 2 Bright A_FadeOut(0.03)
    Loop
  }
}

Actor DSAttackTrail2
{
  Height 0
  Radius 0
  Mass 0
  +MISSILE
  +NOBLOCKMAP
  +NOGRAVITY
  +DONTSPLASH
  RenderStyle Add
  Alpha 1
  Scale 0.025
  States
  {
  Spawn:
    WFLR A 1 bright
  Fade:
    WFLR A 2 Bright A_FadeOut(0.03)
    Loop
  }
}

ACTOR Sorcerer2FX2Enhanced : Sorcerer2FX2 replaces Sorcerer2FX2
{
  States
  {
  Spawn:
    TNT1 A 0 
	DEFL A 0 BRIGHT A_SpawnItemEx("WizAttackTrail", Random(-7, 7), Random(-7, 7), Random(0, 9), Random(1, 3), 0, (0.1)*Random(-10, 10), Random(-20, 20), 128)
    FX11 A 5 BRIGHT
	DEFL A 0 BRIGHT A_SpawnItemEx("WizAttackTrail", Random(-7, 7), Random(-7, 7), Random(0, 9), Random(1, 3), 0, (0.1)*Random(-10, 10), Random(-20, 20), 128)
    FX11 A 5 BRIGHT
	DEFL A 0 BRIGHT A_SpawnItemEx("WizAttackTrail", Random(-7, 7), Random(-7, 7), Random(0, 9), Random(1, 3), 0, (0.1)*Random(-10, 10), Random(-20, 20), 128)
    FX11 A 5 BRIGHT
	DEFL A 0 BRIGHT A_SpawnItemEx("WizAttackTrail", Random(-7, 7), Random(-7, 7), Random(0, 9), Random(1, 3), 0, (0.1)*Random(-10, 10), Random(-20, 20), 128)
    FX11 A 5 BRIGHT
	DEFL A 0 BRIGHT A_SpawnItemEx("WizAttackTrail", Random(-7, 7), Random(-7, 7), Random(0, 9), Random(1, 3), 0, (0.1)*Random(-10, 10), Random(-20, 20), 128)
    FX11 A 5 BRIGHT
	DEFL A 0 BRIGHT A_SpawnItemEx("WizAttackTrail", Random(-7, 7), Random(-7, 7), Random(0, 9), Random(1, 3), 0, (0.1)*Random(-10, 10), Random(-20, 20), 128)
    FX11 A 5 BRIGHT
	DEFL A 0 BRIGHT A_SpawnItemEx("WizAttackTrail", Random(-7, 7), Random(-7, 7), Random(0, 9), Random(1, 3), 0, (0.1)*Random(-10, 10), Random(-20, 20), 128)
    FX11 A 5 BRIGHT
    FX11 A 5 BRIGHT A_GenWizard
    FX11 B 5 BRIGHT
    Goto Spawn+1
  Death:
    FX11 CDEFG 5 BRIGHT
    Stop

  }
}


//-----

//-----
ACTOR DsparilChargeFlare : Baseflare
{
   Scale 0.1
   Alpha 1
   +NOGRAVITY
   +NOCLIP
   +NOBLOCKMAP
   vspeed 1
   States
   {
   Spawn: 
	GLIT B 7 Bright
   Death:
	GLIT B 1 Bright A_Fadeout
	loop
   }
}

ACTOR DsparilChargeFlare2 : Baseflare
{
   Scale 0.1
   Alpha 1
   +NOGRAVITY
   +NOCLIP
   +NOBLOCKMAP
   vspeed 2
   States
   {
   Spawn: 
	GLIT B 7 Bright
   Death:
	GLIT B 1 Bright A_Fadeout
	loop
   }
}

Actor DSparilBoomFlare
{
  Height 0
  Radius 0
  Mass 0
  +MISSILE
  +NOBLOCKMAP
  +NOGRAVITY
  +DONTSPLASH
  RenderStyle Add
  Scale 0.1
  States
  {
  Spawn:
  Death:
    BGZF A 2 Bright A_FadeOut(0.1)
    Loop
  }
}

Actor DSparilBoomFlare2
{
  Height 0
  Radius 0
  Mass 0
  +MISSILE
  +NOBLOCKMAP
  +NOGRAVITY
  +DONTSPLASH
  RenderStyle Add
  Scale 0.1
  States
  {
  Spawn:
  Death:
    WFLR A 2 Bright A_FadeOut(0.1)
    Loop
  }
}

Actor DSparilBoltFlare : DSparilBoomFlare
{
scale 0.085
States
  {
  Spawn:
  Death:
    BGZF A 1 Bright A_FadeOut(0.1)
    Loop
  }
}

Actor DSparilBoltFlare2 : DSparilBoomFlare
{
scale 0.085
States
  {
  Spawn:
  Death:
    WFLR A 1 Bright A_FadeOut(0.1)
    Loop
  }
}