actor sstdoomimp : doomimp //replaces doomimp
{
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", 70
maxtargetrange 1175
states
  {
  Spawn:
    TROO AB 10 A_Look
    loop
  See:
    TROO AABBCCDD 3 A_Chase
    loop
  Melee:
  Missile:
    TROO CEF 8 A_FaceTarget
    TROO G 6 A_TroopAttack  // See DoomImpBall
    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:
    TROO H 0 //ACS_ExecuteAlways(926,0, 8,181,0)//bloodcolor is 181
    TROO H 0
    TROO H 2
    TROO H 2 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(-30,"XDeath")
	goto Death
  Death:
    TROO I 0 A_Jump(128, "DeathB", "DeathC")
    TROO I 7
    TROO J 7 A_Scream
    TROO K 5
    TROO L 5 A_NoBlocking
    TROO M -1
    stop
  DeathB:
    TROO I 5
	TRRO A 5 A_Scream
	TRRO B 6
	TRRO C 6 A_NoBlocking
	TRRO D 5
	TRRO E -1
	stop
  DeathC:
    TROO I 5
    TROO V 7 A_Scream
    TROO W 7
    TROO X 7 A_NoBlocking
    TROO Y -1
    stop
  Death.Chainsaw:
    TROO H 0 A_Facetarget
	POSS H 0 A_Playsoundex("misc/slop2", "soundslot5")//A_XScream
    TROO HN 5 A_Scream
    TROO NNNN 1 A_DropItem("SSTHealthBonus",1,127)
    TROO O 4 //A_Playsoundex("misc/slop2", "soundslot5")//A_XScream
    TROO P 4 A_SpawnItemEx ("BloodFXSpawner", 0,0,0, 0,0,0, 0, 160) 
	TNT1 A 0 Bright A_SpawnItemEx ("impheadgib", 0,0,0, 0,random(0,60)*0.1,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION, 176)
	NULL A 0 A_SpawnItemEx ("BloodFXSpawner", 0, 0, 0, 0, 0, 0, 0, 160) 
    TROO Q 6 A_NoBlocking
    NULL A 0 A_SpawnDebris ("BloodSpotSilent")
    TROO RRSSTT 3 A_SpawnItemEx ("BloodFXSpawner", 0,0,random(0,40), 0,0,0, 0, 160,127) 
    TROO U -1
    stop
  XDeath:
    TROO N 3
    TROO O 3 A_Playsoundex("misc/slop2", "soundslot5")//A_XScream
	TNT1 A 0 Bright A_SpawnItemEx ("impheadgib", 0,0,40, 0,random(-10,10)*0.1,0, 0, SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION, 32)
    TROO 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) 
    TROO Q 3 A_NoBlocking
    NULL A 0 A_SpawnDebris ("BloodSpotSilent")
    TROO RRSSTT 1 A_SpawnItemEx ("BloodFXSpawner", 0,0,random(0,40), 0,0,0, 0, 160,127) 
    TROO U -1
    stop
  Death.Shotgun:
    TROO H 0 A_JumpIfCloser(56,1)//41
	Goto Death
    //NULL A 0 A_Jump(127, "XDeath")
    TROO H 0 A_NoBlocking
    tnt1 H 70 A_SpawnItemEx ("ImpRagdoll", 0,0,0, momx*2,momy*2,2, 0, SXF_ABSOLUTEMOMENTUM|SXF_NOCHECKPOSITION|SXF_TRANSFERTRANSLATION) 
	Stop
  Death.Rocket:
    TROO H 0 A_JumpIfHealthLower(-30,"XDeath")
    TROO H 0 A_NoBlocking
    tnt1 H 70 A_SpawnItemEx ("ImpRagdoll", 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:
    TROO ML 8
    TROO 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+2
  Pain.BluePaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 1,0,0)
	Goto Pain+2
  Pain.RedPaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 2,0,0)
	Goto Pain+2
  Pain.OrangePaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 3,0,0)
	Goto Pain+2
  Pain.PurplePaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 4,0,0)
	Goto Pain+2
  Pain.WhitePaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 5,0,0)
	Goto Pain+2
  Pain.YellowPaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 6,0,0)
	Goto Pain+2
  Pain.BlackPaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 7,0,0)
	Goto Pain+2
	}
}

actor SSTDoomImpBall : DoomImpBall replaces DoomImpBall
{
  Game Doom
  SpawnID 10
  Projectile
  Radius 6
  Height 8
  Speed 16
  FastSpeed 16
  Damage 4
  -NOGRAVITY
  Gravity 0.012
  +RANDOMIZE
	+FORCEXYBILLBOARD
  RenderStyle Add
  Alpha 1
  SeeSound "imp/attack"
  DeathSound "imp/shotx"
  
  damagetype "fire" //added in v1.4rc2
  States
  {
  Spawn:
    BAL1 A 1 bright
	NULL A 0 A_SpawnItemEx ("ImpBallSmokeTrail", 0, random(0,4), 0, 0, 0, 0, 0, 160) 
    BAL1 A 0 A_JumpIf(waterlevel > 1, "WaterDeath")
    BAL1 A 1 bright
	NULL A 0 A_SpawnItemEx ("ImpBallSmokeTrail", 0, 0, random(0,4), 0, 0, 0, 0, 160) 
    BAL1 A 0 A_JumpIf(waterlevel > 1, "WaterDeath")
    BAL1 A 1 bright
	NULL A 0 A_SpawnItemEx ("ImpBallSmokeTrail", 0, random(-4,0), 0, 0, 0, 0, 0, 160) 
    BAL1 A 0 A_JumpIf(waterlevel > 1, "WaterDeath")
    BAL1 A 1 bright
	NULL A 0 A_SpawnItemEx ("ImpBallSmokeTrail", 0, 0, random(-4,0), 0, 0, 0, 0, 160) 
    BAL1 A 0 A_JumpIf(waterlevel > 1, "WaterDeath")
    BAL1 B 1 bright
	NULL A 0 A_SpawnItemEx ("ImpBallSmokeTrail", 0, random(0,4), 0, 0, 0, 0, 0, 160) 
    BAL1 A 0 A_JumpIf(waterlevel > 1, "WaterDeath")
    BAL1 B 1 bright
	NULL A 0 A_SpawnItemEx ("ImpBallSmokeTrail", 0, 0, random(0,4), 0, 0, 0, 0, 160) 
    BAL1 A 0 A_JumpIf(waterlevel > 1, "WaterDeath")
    BAL1 B 1 bright
	NULL A 0 A_SpawnItemEx ("ImpBallSmokeTrail", 0, random(-4,0), 0, 0, 0, 0, 0, 160) 
    BAL1 A 0 A_JumpIf(waterlevel > 1, "WaterDeath")
    BAL1 B 1 bright
	NULL A 0 A_SpawnItemEx ("ImpBallSmokeTrail", 0, 0, random(-4,0), 0, 0, 0, 0, 160) 
    BAL1 A 0 A_JumpIf(waterlevel > 1, "WaterDeath")
    loop
  WaterDeath:
	TNT1 A 0 A_Playsound("flesh/fry",CHAN_5)
  	TNT1 AAAAA 1 A_SpawnItemEx ("UnderwaterSteam", 0,0,random(0,16), random(-1,1),random(-3,3),random(0,2), 0, 160, 64)  
    TNT1 A 0
	Stop
  Death:
	NULL A 0 A_SpawnItemEx ("ImpBallParticles", 0,0,0, 0,0,0, 0, 160) 
    BAL1 CDE 6 bright
    stop
  }
}

ACTOR ImpBallSmokeTrail
{
   Radius 1
   Height 1
   PROJECTILE
   +NOCLIP
   Scale 0.25//0.13
   Speed 0
	+FORCEXYBILLBOARD
   RENDERSTYLE ADD
   ALPHA 0.66
   States
   {
   Spawn:
    	TNT1 A 0
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    	TNT1 A 1
      TNT1 A 0 A_Jump(128, "Spawn2", "Spawn3")
      SMKG AABBCCDDEEFFGGHHIIJJKK 1 BRIGHT A_Fadeout(0.03)
      Stop
   Spawn2:
      SMKG ABCDEFGHIJK 1 BRIGHT A_Fadeout(0.06)
      Stop
   Spawn3:
      SMKG ABCDEFGHIJKKKKKKKKKKKK 1 BRIGHT A_Fadeout(0.03)
      Stop
   }
}


ACTOR UnderwaterSteam : ImpBallSmokeTrail
{
scale 1.0
alpha 0.8
}