//Explosion graphics are property of Captain Toenail and Epic Games (Unreal)
//Smoke was around for so long that I can't really tell from where they came first.

//Missile

ACTOR MissileExplode
{ 
    +NOINTERACTION
    +NOGRAVITY
    States
    {
    Spawn:
      TNT1 A 0
      TNT1 A 0 A_Quake(3, 15, 0, 256, none) 
      TNT1 A 0 A_SpawnItemEx("MissileExploder", random(13,-13), random(13,-13), random(13,-13), 0.1*random(6,8), 0.1*random(6,8), 0.1*random(6,8), random(0,360), 128, 0)
      TNT1 AA 0 A_SpawnItemEx("MissileExpSmoke", random(13,-13), random(13,-13), random(13,-13), 0.1*random(2,5), 0.1*random(2,5), 0.1*random(2,5), random(0,360), 128, 0)
      TNT1 AAAAA 5 A_SpawnItemEx("MissileExpSmoke", random(13,-13), random(13,-13), random(13,-13), 0.1*random(2,5), 0.1*random(2,5), 0.1*random(2,5), random(0,360), 128, 0)
      Stop
    }
}

ACTOR MissileExpSmoke
{ 
    Scale 0.65
    Alpha 0.6
    RenderStyle Normal
    +NOINTERACTION
    +NOGRAVITY
	+CLIENTSIDEONLY
    +THRUGHOST
    +DONTSPLASH
    States
    {
    Spawn:
      SMKE A 0
      SMKE A 0 A_FadeOut(0.1)
      SMKE A 0 A_Jump(255,"SmokeA","SmokeB","SmokeC","SmokeD","SmokeE","SmokeF","SmokeG","SmokeH","SmokeI","SmokeJ","SmokeK")
    SmokeA:
      SMKE A 0 A_FadeOut(0.025)
      SMKE A 3 //A_SetScale(ScaleX +0.005, ScaleY +0.005)
      Loop
    SmokeB:
      SMKE A 0 A_FadeOut(0.025)
      SMKE B 3 //A_SetScale(ScaleX +0.005, ScaleY +0.005)
      Loop
    SmokeC:
      SMKE A 0 A_FadeOut(0.025)
      SMKE C 3 //A_SetScale(ScaleX +0.005, ScaleY +0.005)
      Loop
    SmokeD:
      SMKE A 0 A_FadeOut(0.025)
      SMKE D 3 //A_SetScale(ScaleX +0.005, ScaleY +0.005)
      Loop
    SmokeE:
      SMKE A 0 A_FadeOut(0.025)
      SMKE E 3 //A_SetScale(ScaleX +0.005, ScaleY +0.005)
      Loop
    SmokeF:
      SMKE A 0 A_FadeOut(0.025)
      SMKE F 3 //A_SetScale(ScaleX +0.005, ScaleY +0.005)
      Loop
    SmokeG:
      SMKE A 0 A_FadeOut(0.025)
      SMKE G 3 //A_SetScale(ScaleX +0.005, ScaleY +0.005)
      Loop
    SmokeH:
      SMKE A 0 A_FadeOut(0.025)
      SMKE H 3 //A_SetScale(ScaleX +0.005, ScaleY +0.005)
      Loop
    SmokeI:
      SMKE A 0 A_FadeOut(0.025)
      SMKE I 3 //A_SetScale(ScaleX +0.005, ScaleY +0.005)
      Loop
    SmokeJ:
      SMKE A 0 A_FadeOut(0.025)
      SMKE J 3 //A_SetScale(ScaleX +0.005, ScaleY +0.005)
      Loop
    SmokeK:
      SMKE A 0 A_FadeOut(0.025)
      SMKE A 3 //A_SetScale(ScaleX +0.005, ScaleY +0.005)
      Loop
    }
}

ACTOR MissileExploder
{ 
    +NOINTERACTION
    +NOGRAVITY
	+CLIENTSIDEONLY
    States
    {
    Spawn:
      TNT1 A 0
      TNT1 AAA 2 A_SpawnItemEx("MissileExp", random(7,-7), random(7,-7), random(7,-7), 0, 0, 0, 0, 128, 0)
      Stop
    }
}

ACTOR MissileExp
{
  Radius 1
  Height 1
  +NOGRAVITY
  +NOINTERACTION
  +CLIENTSIDEONLY
  +THRUGHOST
  +DONTSPLASH
  Renderstyle Add
  Scale 1.65
  states
  {
  Spawn:
    TNT1 A 1
    TNT1 A 0 A_Jump(255,"Exp1","Exp2","Exp3","Exp4","Exp5")
    stop
  Exp1:
    EXP6 ABCDEFGH 2 Bright //A_SetScale(ScaleX -0.01, ScaleY -0.01)
    Goto Death
  Exp2:
    EXP7 ABCDEFGH 2 Bright //A_SetScale(ScaleX -0.01, ScaleY -0.01)
    Goto Death
  Exp3:
    EXP8 ABCDEFGH 2 Bright //A_SetScale(ScaleX -0.01, ScaleY -0.01)
    Goto Death
  Exp4:
    EXP9 ABCDEFGH 2 Bright //A_SetScale(ScaleX -0.01, ScaleY -0.01)
    Goto Death
  Exp5:
    EXP0 ABCDEFGH 2 Bright //A_SetScale(ScaleX -0.01, ScaleY -0.01)
    Goto Death
  Death:
    TNT1 A 1
    stop
  }
}

//Larpa & Gauss
ACTOR PelletExplode
{ 
    +NOINTERACTION
    +NOGRAVITY
    States
    {
    Spawn:
      TNT1 A 0
      TNT1 A 0 A_Quake(1, 8, 0, 192, none)
      TNT1 AA 0 A_SpawnItemEx("PelletExploder", 0, 0, 0, 0.1*random(13,20), 0.1*random(13,20), 0.1*random(13,20), random(0,360), 128, 0)
      TNT1 AAA 2 A_SpawnItemEx("PelletExpSmoke", 0, 0, 0, 0.1*random(1,3), 0.1*random(1,3), 0.1*random(1,3), random(0,360), 128, 0)
      Stop
    }
}
ACTOR PelletExpSmoke : MissileExpSmoke
{ 
    Scale 0.4
	+CLIENTSIDEONLY
}

ACTOR PelletExploder
{ 
    +NOINTERACTION
	+CLIENTSIDEONLY
    +NOGRAVITY
    States
    {
    Spawn:
      TNT1 A 0
      TNT1 AAA 2 A_SpawnItemEx("PelletExp", 0.1*random(40,30), 0.1*random(40,30), 0.1*random(40,30), 0, 0, 0, 0, 128, 0)
      Stop
    }
}

ACTOR PelletExp : MissileExp
{
  Scale 0.85
  +CLIENTSIDEONLY
}

//Deathhead
ACTOR DeathHeadExplode
{ 
    +NOINTERACTION
    +NOGRAVITY
    States
    {
    Spawn:
    TNT1 A 0
    TNT1 A 0 A_Quake(7, 25, 0, 512, none)
    TNT1 AA 0 A_SpawnItemEx("DeathHeadSmoke", random(50,-50), random(50,-50), random(50,-50), 0.1*random(4,6), 0.1*random(4,6), 0.1*random(3,5), random(0,360),0,0)
    TNT1 AAAA 0 A_SpawnItemEx("DeathHeadExploder", random(2,-2), random(2,-2), random(2,-2), random(1,-1), random(1,-1), random(1,-1), random(0,360), SXF_TRANSFERPOINTERS, 0)
    TNT1 A 5
    TNT1 A 0 A_SpawnItemEx("DeathHeadAfterSmoke",0,0,0,0,0,0,0,128,0)
    TNT1 AAAAAAA 6 A_SpawnItemEx("DeatheadAfterboom", random(30,-30), random(30,-30), random(30,-30), 0.1*random(3,4), 0.1*random(3,4), 0.1*random(2,3), random(0,360), 128, 0)
    Stop
    }
}

ACTOR DeathHeadShock
{
    Scale 1.5
    Alpha 1
    RenderStyle Add
    +NOGRAVITY
    +NOINTERACTION
	+CLIENTSIDEONLY
    +THRUGHOST
    +DONTSPLASH
    States
    {
    Spawn:
      BIGB ABCDEFGHIJKLMNOPQRSTU 2 BRIGHT
      Stop
    }
}

ACTOR DeathHeadSmoke : MissileExpSmoke
{ 
    Scale 1.25
    Alpha 0.5
	+CLIENTSIDEONLY
}

ACTOR DeathHeadExploder
{ 
    +NOINTERACTION
    +FORCERADIUSDMG
    +NOGRAVITY
    ReactionTime 10
    States
    {
    Spawn:
    TNT1 A 0
    TNT1 A 0 A_Countdown
    TNT1 A 0 A_Explode(25,192,0,1)
    TNT1 A 2 A_SpawnItemEx("DeathHeadExp", random(28,-28), random(28,-28), random(28,-28), 0, 0, 0, 0, 128, 0)
    Loop
    Death:
    TNT1 A 1
    Stop
    }
}

ACTOR DeathHeadExp
{
  Radius 1
  Height 1
  +NOGRAVITY
  +NOINTERACTION
  +CLIENTSIDEONLY
  +THRUGHOST
  +DONTSPLASH
  Renderstyle Add
  Scale 3.25
  states
  {
  Spawn:
    TNT1 A 1
    TNT1 A 0 A_Jump(255,"Exp1","Exp2")
    stop
  Exp1:
    TNT1 A 0
    EXP1 ABCDEFGHIJKLMNOP 1 Bright
    Goto Death
  Exp2:
    TNT1 A 0
    EXP2 ABCDEFGHIJKLMNOP 1 Bright
    Goto Death
  Death:
    TNT1 A 1
    stop
  }
}

ACTOR DeatheadAfterboom : DeathHeadSmoke
{ 
    Scale 1
    Alpha 0.6
	+CLIENTSIDEONLY
}

ACTOR DeathHeadAfterSmoke
{ 
    +NOINTERACTION
	+CLIENTSIDEONLY
    +NOGRAVITY
    States
    {
    Spawn:
    TNT1 A 0
    TNT1 AAAAAA 5 A_SpawnItemEx("DeathHeadSmoke", random(25,-25), random(25,-25), random(25,-25), 0.1*random(2,3), 0.1*random(2,3), 0.1*random(2,3), random(0,360),0,0)
    Stop
    }
}

ACTOR DeathHeadMissileExplode
{ 
    +NOINTERACTION
    +NOGRAVITY
    States
    {
    Spawn:
      TNT1 A 0
      TNT1 AA 0 A_SpawnItemEx("DeathHeadMissileExploder", random(9,-9), random(9,-9), random(9,-9), 0, 0, 0, 0, 128, 0)
      Stop
    }
}

ACTOR DeathHeadMissileExploder
{ 
    +NOINTERACTION
    +NOGRAVITY
    States
    {
    Spawn:
      TNT1 A 13
      TNT1 AAAA 2 A_SpawnItemEx("DeathHeadMissileExp", random(40,-40), random(40,-40), random(40,-40), 0, 0, 0, 0, 128, 0)
      Stop
    }
}

ACTOR DeathHeadMissileExp
{
  Radius 1
  Height 1
  +THRUGHOST
  +DONTSPLASH
  +NOGRAVITY
  +DOOMBOUNCE
  +NOINTERACTION
  Renderstyle Add
  Scale 2.45
  states
  {
  Spawn:
    TNT1 A 1
    TNT1 A 0 A_Jump(255,"Exp1","Exp2","Exp3","Exp4","Exp5")
    stop
  Exp1:
    EXP6 ABCDEFGH 2 Bright A_Explode(5,128)
    Goto Death
  Exp2:
    EXP7 ABCDEFGH 2 Bright A_Explode(5,128)
    Goto Death
  Exp3:
    EXP8 ABCDEFGH 2 Bright A_Explode(5,128)
    Goto Death
  Exp4:
    EXP9 ABCDEFGH 2 Bright A_Explode(5,128)
    Goto Death
  Exp5:
    EXP0 ABCDEFGH 2 Bright A_Explode(5,128)
    Goto Death
  Death:
    TNT1 A 1
    stop
  }
}

//Pushka

ACTOR PushkaExplode
{ 
    +NOINTERACTION
    +NOGRAVITY
    States
    {
    Spawn:
    TNT1 A 0
    TNT1 A 0 A_Quake(5, 18, 0, 328, none)
    TNT1 AA 0 A_SpawnItemEx("DeathHeadSmoke", random(35,-35), random(35,-35), random(35,-35), 0.1*random(4,6), 0.1*random(4,6), 0.1*random(3,5), random(0,360),0,0)
    TNT1 AAAA 0 A_SpawnItemEx("PushkaExploder", random(2,-2), random(2,-2), random(2,-2), random(1,-1), random(1,-1), random(1,-1), random(0,360), SXF_TRANSFERPOINTERS, 0)
    TNT1 A 1
    TNT1 A 0 A_SpawnItemEx("DeathHeadAfterSmoke",0,0,0,0,0,0,0,128,0)
    TNT1 AAAAAAA 6 A_SpawnItemEx("DeatheadAfterboom", random(20,-20), random(20,-20), random(20,-20), 0.1*random(3,4), 0.1*random(3,4), 0.1*random(2,3), random(0,360), 128, 0)
    Stop
    }
}

ACTOR PushkaExploder : DeathHeadExploder
{ 
    +NOINTERACTION
    +FORCERADIUSDMG
    +NOGRAVITY
    ReactionTime 5
    States
    {
    Spawn:
    TNT1 A 0
    TNT1 A 0 A_Countdown
    TNT1 A 0 A_Explode(25,192,0,1)
    TNT1 A 2 A_SpawnItemEx("DeathHeadExp", random(28,-28), random(28,-28), random(28,-28), 0, 0, 0, 0, 128, 0)
    Loop
    Death:
    TNT1 A 1
    Stop
    }
}

ACTOR PushkaExplodeSmall : PushkaExplode
{ 
    +NOINTERACTION
    +NOGRAVITY
    States
    {
    Spawn:
    TNT1 A 0
    TNT1 A 0 A_SpawnItemEx("DeathHeadSmoke", random(16,-16), random(16,-16), random(16,-16), 0.1*random(4,6), 0.1*random(4,6), 0.1*random(3,5), random(0,360),0,0)
    TNT1 AAA 0 A_SpawnItemEx("PushkaExploder", random(4,-4), random(4,-4), random(4,-4), random(1,-1), random(1,-1), random(1,-1), random(0,360), 128, 0)
    TNT1 A 1
    TNT1 A 0 A_SpawnItemEx("DeathHeadAfterSmoke",0,0,0,0,0,0,0,128,0)
    TNT1 AAAA 1 A_SpawnItemEx("DeatheadAfterboom", random(5,-5), random(5,-5), random(5,-5), 0.1*random(2,3), 0.1*random(2,3), 0.1*random(2,3), random(0,360),0,0)
    Stop
    }
}
