Actor Catharsi : sstdoomimp 29123
{
//$Category Monsters
  Obituary "%o was blasted by a catharsi."
  Health 120
  Radius 20
  Height 56
  Mass 100
  Speed 8
  PainChance 140
  SeeSound "catharsi/sit"
  PainSound "catharsi/pain"
  DeathSound "catharsi/death"
  ActiveSound "imp/active"
  dropitem "SSTAutoStim" 128
  Monster
  +FloorClip
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
  var int user_sweep;
  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:
    SDDM AB 10 A_Look
    Loop
  See:
    SDDM AABBCCDD 3 A_Chase
    Loop
  Melee:
  Missile:
    // [Blue Shadow] This will randomly pick either 1 or -1, and depending on the picked number,
    // the monster will either sweep from left to right, or right to left.
    // (randompick() could have benn used here instead, but that function has not made it into
    // Zandronum yet, and this is an old monster which already works in said port. We do not want it
    // to become "broken" suddenly)
    SDDM E 0 A_SetUserVar("user_sweep", (random(0, 1) * 2) - 1)

    SDDM E 4
    SDDM E 10 A_FaceTarget
    SDDM F 2 Bright A_CustomMissile("CatharsiBall", 30, 8, -4 * user_sweep)
    SDDM E 2
    SDDM F 2 Bright A_CustomMissile("CatharsiBall", 30, 8, 0)
    SDDM E 2
    SDDM F 2 Bright A_CustomMissile("CatharsiBall", 30, 8, 4 * user_sweep)
    SDDM E 2
    SDDM F 2 Bright A_CustomMissile("CatharsiBall", 30, 8, 8 * user_sweep)
    SDDM E 2
    SDDM F 2 Bright A_CustomMissile("CatharsiBall", 30, 8, 12 * user_sweep)
    SDDM E 2
    SDDM F 2 Bright A_CustomMissile("CatharsiBall", 30, 8, 16 * user_sweep)
    SDDM E 2
    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:
    SDDM G 3
    SDDM G 3 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.Shotgun:
  Death.Rocket:
  Death:
    SDDM H 4
    SDDM I 4 A_Scream
    SDDM J 4 A_NoBlocking
    SDDM J 0 A_SpawnItem("CatharsiDetonator", 0, 30)
    SDDM KLM 4
    SDDM N -1
    Stop
  Death.Chainsaw:
	SDDM OOOO 0 A_DropItem("SSTHealthBonus",1,127)
  xDeath.Shotgun:
  xDeath.Rocket:
  XDeath:
    SDDM O 4
    SDDM P 4 A_XScream
    SDDM Q 4 A_NoBlocking
    SDDM RRSSTTUUVV 2 A_SpawnItemEx ("BloodFXSpawner", 0,0,random(0,40), 0,0,0, 0, 160,127) 
    SDDM W -1
    Stop
  Raise:
    SDDM NMLKJIH 5
    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 CatharsiBall
{
  Radius 6
  Height 8
  Speed 15
  Damage 3
  RenderStyle "Add"
  SeeSound "catharsi/shotsit"
  DeathSound "catharsi/shotdth"
  Projectile
  +Randomize
  Decal "PlasmaScorchLower"
  States
  {
  Spawn:
    SDFB A 4 Bright
    Loop
  Death:
    SDFB BCDE 6 Bright
    Stop
  }
}

Actor CatharsiDetonator
{
  Obituary "%o was blasted by a catharsi's detonator."
  Radius 6
  Height 8
  DeathSound "catharsi/shotdth"
  +Shootable
  +Solid
  +IsMonster
  +FloatBob
  +Randomize
  +NoGravity
  +NoBlood
  +DontFall
  States
  {
  Spawn:
    THRM A 4 A_PlaySound("catharsi/thermtick")
    THRM B 16
    THRM A 4 A_PlaySound("catharsi/thermtick")
    THRM B 16
    THRM A 4 A_PlaySound("catharsi/thermtick")
    THRM B 16
    THRM A 4 A_PlaySound("catharsi/thermtick")
    THRM B 16
    THRM A 4 A_PlaySound("catharsi/thermtick")
    THRM B 16
    SDFB B 0 A_CustomMissile("CatharsiBall", 4, 2, 0)
    SDFB B 0 A_CustomMissile("CatharsiBall", 4, 2, 20)
    SDFB B 0 A_CustomMissile("CatharsiBall", 4, 2, 40)
    SDFB B 0 A_CustomMissile("CatharsiBall", 4, 2, 60)
    SDFB B 0 A_CustomMissile("CatharsiBall", 4, 2, 80)
    SDFB B 0 A_CustomMissile("CatharsiBall", 4, 2, 100)
    SDFB B 0 A_CustomMissile("CatharsiBall", 4, 2, 120)
    SDFB B 0 A_CustomMissile("CatharsiBall", 4, 2, 140)
    SDFB B 0 A_CustomMissile("CatharsiBall", 4, 2, 160)
    SDFB B 0 A_CustomMissile("CatharsiBall", 4, 2, 180)
    SDFB B 0 A_CustomMissile("CatharsiBall", 4, 2, 200)
    SDFB B 0 A_CustomMissile("CatharsiBall", 4, 2, 220)
    SDFB B 0 A_CustomMissile("CatharsiBall", 4, 2, 240)
    SDFB B 0 A_CustomMissile("CatharsiBall", 4, 2, 260)
    SDFB B 0 A_CustomMissile("CatharsiBall", 4, 2, 280)
    SDFB B 0 A_CustomMissile("CatharsiBall", 4, 2, 300)
    SDFB B 0 A_CustomMissile("CatharsiBall", 4, 2, 320)
    SDFB B 0 A_CustomMissile("CatharsiBall", 4, 2, 340)
    SDFB B 0 A_Die
  Death:
    SDFB B 0 A_ChangeFlag("FLOATBOB", FALSE)
    SDFB B 6 Bright A_Scream
    SDFB CDE 6 Bright
    Stop
  }
}