
ACTOR SSTDarkImp : DarkImp replaces Darkimp
{
damagefactor "RedPaint", 0.3
damagefactor "OrangePaint", 0.3
damagefactor "YellowPaint", 0.3
damagefactor "GreenPaint", 0.3
damagefactor "BluePaint", 0.3
damagefactor "PurplePaint", 0.3
damagefactor "WhitePaint", 0.3
damagefactor "BlackPaint", 0.3
  PainChance "ShotgunWeak", 32

  Game Doom
  SpawnID 155
  PainChance 128
  Speed 10
  dropitem "SSTMaxArmorBonus" 32
  dropitem "SSTMaxArmorBonus" 16
  Obituary "$OB_DARKIMP" // "%o was burned by a dark imp."
  HitObituary "$OB_DARKIMP_MELEE" // "%o was slashed by a dark imp."
	SeeSound "darkimp/sight"
	PainSound "darkimp/pain"
	DeathSound "darkimp/death"
	ActiveSound "darkimp/active"
  Health 120
  MissileType DarkImpBall
+MISSILEMORE
+MISSILEEVENMORE
  States
  {
  Spawn:
    DRKV AB 10 A_Look
    Loop
  See:
    DRKV AABBCCDD 3 A_Chase
    Loop
  Melee:
  Missile:
    DRKV EF 8 A_FaceTarget
    DRKV G 6 A_ComboAttack  // See DarkImpBall
     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:
    DRKV H 1
    DRKV H 1 A_Pain
    Goto See
  Death.Fire:
	TNT1 A 0 A_Stop
    TNT1 A 0 ACS_ExecuteAlways(926,0, 10,0,0)
	NULL O 0 A_SpawnItemEx ("BurnDeathFX", 0,0,0, momx,momy,momz, 0, SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_ABSOLUTEMOMENTUM)
	Goto Death
  Death.Plasma:
	TNT1 A 0 A_Stop
    TNT1 A 0 ACS_ExecuteAlways(926,0, 10,0,0)
	NULL O 0 A_SpawnItemEx ("PlasmaDeathFX", 0,0,0, momx,momy,momz, 0, SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_ABSOLUTEMOMENTUM)
    TROO H 0 A_JumpIfHealthLower(-60,"XDeath")
	goto Death
  Death:
    DRKV H 1
    DRKV L 6
    DRKV M 6 A_Scream
    DRKV N 4
    DRKV O 4 A_NoBlocking
    DRKV P -1
    Stop
  Death.Chainsaw:
    DIMP H 0 A_Facetarget
	POSS H 0 A_Playsoundex("misc/slop2", "soundslot5")//A_XScream
    DIMP HNN 5 A_Scream
    DIMP NNNN 1 A_DropItem("SSTHealthBonus",1,127)
    DIMP O 4 //A_Playsoundex("misc/slop2", "soundslot5")//A_XScream
    DIMP P 4 A_SpawnItemEx ("BloodFXSpawner", 0, 0, 0, 0, 0, 0, 0, 160) 
	NULL A 0 A_SpawnItemEx ("BloodFXSpawner", 0, 0, 0, 0, 0, 0, 0, 160) 
    DIMP Q 6 A_NoBlocking
    NULL A 0 A_SpawnDebris ("BloodSpotSilent")
    DIMP RRSSTT 3 A_SpawnItemEx ("BloodFXSpawner", 0,0,random(0,40), 0,0,0, 0, 160,127) 
    DIMP U -1
    stop
  XDeath:
    DIMP N 3
    DIMP O 3 A_Playsoundex("misc/slop2", "soundslot5")//A_XScream
    DIMP P 3 A_SpawnItemEx ("BloodFXSpawner", 0, 0, 0, 0, 0, 0, 0, 160) 
	NULL A 0 A_SpawnItemEx ("BloodFXSpawner", 0, 0, 0, 0, 0, 0, 0, 160) 
    DIMP Q 3 A_NoBlocking
    NULL A 0 A_SpawnDebris ("BloodSpotSilent")
    DIMP RRSSTT 1 A_SpawnItemEx ("BloodFXSpawner", 0,0,random(0,40), 0,0,0, 0, 160,127) 
    DIMP U -1
    stop
  Death.Shotgun:
    TROO H 0 A_JumpIfCloser(56,1)//41
	Goto Death
    TROO H 0 A_NoBlocking
    tnt1 H 70 A_SpawnItemEx ("DarkImpRagdoll", 0,0,0, momx*2,momy*2,2, 0, SXF_ABSOLUTEMOMENTUM|SXF_NOCHECKPOSITION|SXF_TRANSFERTRANSLATION) 
	Stop
  Death.Rocket:
    TROO H 0 A_JumpIfHealthLower(-60,"XDeath")
    TROO H 0 A_NoBlocking
    tnt1 H 70 A_SpawnItemEx ("DarkImpRagdoll", 0,0,0, momx*random(1.25,1.75),momy*random(1.25,1.75),momz*3.0, 0, SXF_ABSOLUTEMOMENTUM|SXF_NOCHECKPOSITION|SXF_TRANSFERTRANSLATION) 
	Stop
  Raise:
    DIMP ML 8
    DIMP KJI 6
    Goto See

    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
	  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 SSTDarkImpBall : DarkImpBall replaces DarkImpBall
{
  Game Doom
  SpawnID 218
  Damagetype "plasma"
	+FORCEXYBILLBOARD
  //Speed 20
  //Damage 3
  States
  {
  Spawn:
    BAL4 A 1 Bright
	NULL A 0 A_SpawnItemEx ("DarkImpBallTrail", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL A 0 A_SpawnItemEx ("DarkImpCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
	NULL A 0 A_SpawnItemEx ("DarkImpBallTrail", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL A 0 A_SpawnItemEx ("DarkImpCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
    BAL4 A 1 Bright
	NULL A 0 A_SpawnItemEx ("DarkImpBallTrail", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL A 0 A_SpawnItemEx ("DarkImpCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
	NULL A 0 A_SpawnItemEx ("DarkImpBallTrail", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL A 0 A_SpawnItemEx ("DarkImpCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
    BAL4 A 1 Bright
	NULL A 0 A_SpawnItemEx ("DarkImpBallTrail", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL A 0 A_SpawnItemEx ("DarkImpCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
	NULL A 0 A_SpawnItemEx ("DarkImpBallTrail", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL A 0 A_SpawnItemEx ("DarkImpCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
    BAL4 A 1 Bright
	NULL A 0 A_SpawnItemEx ("DarkImpBallTrail", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL A 0 A_SpawnItemEx ("DarkImpCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
	NULL A 0 A_SpawnItemEx ("DarkImpBallTrail", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL A 0 A_SpawnItemEx ("DarkImpCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
    BAL4 B 1 Bright
	NULL A 0 A_SpawnItemEx ("DarkImpBallTrail", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL A 0 A_SpawnItemEx ("DarkImpCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
	NULL A 0 A_SpawnItemEx ("DarkImpBallTrail", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL A 0 A_SpawnItemEx ("DarkImpCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
    BAL4 B 1 Bright
	NULL A 0 A_SpawnItemEx ("DarkImpBallTrail", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL A 0 A_SpawnItemEx ("DarkImpCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
	NULL A 0 A_SpawnItemEx ("DarkImpBallTrail", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL A 0 A_SpawnItemEx ("DarkImpCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
    BAL4 B 1 Bright
	NULL A 0 A_SpawnItemEx ("DarkImpBallTrail", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL A 0 A_SpawnItemEx ("DarkImpCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
	NULL A 0 A_SpawnItemEx ("DarkImpBallTrail", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL A 0 A_SpawnItemEx ("DarkImpCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
    BAL4 B 1 Bright
	NULL A 0 A_SpawnItemEx ("DarkImpBallTrail", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL A 0 A_SpawnItemEx ("DarkImpCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
	NULL A 0 A_SpawnItemEx ("DarkImpBallTrail", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL A 0 A_SpawnItemEx ("DarkImpCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
    Loop
  Death:
	NULL A 0 A_SpawnItemEx ("BlueParticleSphere", 0,0,0, 0,0,0, 0, 160) 
    BAL4 CDE 6 Bright
    Stop
  }
}

ACTOR DarkImpBallTrail
{
   Radius 1
   Height 1
   PROJECTILE
   +NOCLIP
	+FORCEXYBILLBOARD
   Scale 1.2
   Speed 0
   Renderstyle Add
   translation "80:95 = 192:207"
   ALPHA 0.4
   States
   {
   Spawn:
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
      TNT1 A 0 A_Jump(128, "Spawn2", "Spawn3")
      STAR AAAAAAAAAAAAAAAAAAAAAA 1 BRIGHT A_Fadeout(0.015)
      Stop
   Spawn2:
	  STAR AAAAAAAAAAA 1 BRIGHT A_Fadeout(0.03)
      Stop
   Spawn3:
      STAR AAAAAAAAAAAAAAAAA 1 BRIGHT A_Fadeout(0.02)
      Stop
   }
}

ACTOR DarkImpCrackleSpawner
{
	+NOTELEPORT
  Radius 1
  Height 1
  +NOBLOCKMAP
  +NOTELEPORT
  +NOGRAVITY
  +NOCLIP
  -SOLID
  -SHOOTABLE
  RENDERSTYLE NONE
  States
  {
  Spawn:
    TNT1 A 0
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
      TNT1 A 0 Bright A_CustomMissile("DarkImpCrackle1",0,0,random(-180,180),2,random(-90,90))
      TNT1 A 0 Bright A_CustomMissile("DarkImpCrackle2",0,0,random(-180,180),2,random(-90,90))
      Stop
  }
}
ACTOR DarkImpCrackle1
{
  Radius 1
  Height 1
  Speed 5
  Damage 0
  Projectile
  -RANDOMIZE
  +NOCLIP
	+FORCEXYBILLBOARD
  RenderStyle Add
  Alpha 0.88
  scale 0.5
	translation "80:95 = 192:207"
  States
  {
  Spawn:
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    STAR AAAAAAAA 1 bright A_FadeOut(0.1)
    stop
  }
}
ACTOR DarkImpCrackle2
{
  Radius 1
  Height 1
  Speed 4
  Damage 0
  Projectile
  -RANDOMIZE
  +NOCLIP
	+FORCEXYBILLBOARD
  RenderStyle Add
  Alpha 0.84
  scale 0.75
	translation "80:95 = 192:207"
  States
  {
  Spawn:
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    STAR AAAAAAAA 1 bright A_FadeOut(0.1)
    stop
  }
}
