ACTOR SSTArchvile : Archvile replaces Archvile
{
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", 2
  Game Doom
  SpawnID 111
  Health 700
  Radius 20
  Height 56
  Mass 500
  Speed 15
  PainChance 10
  Monster
  MaxTargetRange 896
  +QUICKTORETALIATE 
  +FLOORCLIP 
  +NOTARGET
  +FIREDAMAGE
  SeeSound "vile/sight"
  PainSound "vile/pain"
  DeathSound "vile/death"
  ActiveSound "vile/active"
  MeleeSound "vile/stop"
  Obituary "$OB_VILE" // "%o was incinerated by an archvile."
  dropitem "SSTAutoStim" 64
  States
  {
  Spawn:
    VILE AB 10 A_Look
    Loop
  See:
    VILE AABBCCDDEEFF 2 A_VileChase
    Loop
  Missile:
    VILE G 0 BRIGHT A_VileStart
    VILE G 10 BRIGHT A_FaceTarget
    VILE H 8 BRIGHT A_VileTarget("SSTArchvileFire")
    VILE IJKLMN 8 BRIGHT A_FaceTarget
    VILE O 0 A_VileAttack("vile/stop",20,70,70,0.5,"Fire",VAF_DMGTYPEAPPLYTODIRECT)
	VILE O 0 A_JumpIfTargetInLOS("MissileSuccess")
	Goto MissileFail
  MissileSuccess:
    VILE O 0 A_VileTarget("VileFireBoom")
    VILE O 8 BRIGHT
	//VILE O 0 A_GiveToTarget("HackyHealthChecker",1)
    VILE P 20 BRIGHT
	//VILE O 0 A_JumpIfInventory("YouBurnedMe",1,"EvilLaugh")
	//VILE O 0 A_JumpIfHealthLower(1, "EvilLaugh", AAPTR_TARGET)
	VILE O 0 A_JumpIfInTargetInventory("IsBurning",1,"EvilLaugh")
    Goto See
  MissileFail:
    VILE O 8 BRIGHT
    VILE P 20 BRIGHT
    Goto See
  EvilLaugh:
	VILE O 0 A_PlaySound("vile/laugh", CHAN_6)
	Goto See
  Heal:
    VILE Q 0 A_PlaySound("vile/spell")
    VILE Q 0 A_SpawnItemEx ("ArchShock", 40,0,40, 0,0,0, 0, 160)
    VILE "[\]" 10 BRIGHT
    Goto See
  Pain:
    VILE Q 5   
	VILE Q 0 A_StopSound(CHAN_6)
    VILE Q 5 A_Pain
    Goto See
  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)
	goto Death
  Death:
	VILE Q 0 A_StopSound(CHAN_6)
    VILE Q 0 A_Jump(128, "DeathB")
    VILE Q 6
    VILE R 6 A_Scream
	NULL A 0 A_SpawnItemEx ("BloodcloudSpawner", 0, 0, random(8,16), 0, 0, random(0,1), 0, 160)
    VILE S 6 A_NoBlocking
    VILE TUVWXY 6
    VILE Z -1
    Stop
  DeathB:
    VIGI B 4
    VIGI C 4 A_Scream
    VIGI D 4 A_NoBlocking
    VIGI EFG 3 A_SpawnItemEx ("BloodFXSpawner", 0,0,0, 0,0,0, 0, 160) 
    VIGI HIJ 3
    VIGI J -1
    Stop

    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 See
  Pain.BluePaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 1,0,0)
	Goto See
  Pain.RedPaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 2,0,0)
	Goto See
  Pain.OrangePaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 3,0,0)
	Goto See
  Pain.PurplePaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 4,0,0)
	Goto See
  Pain.WhitePaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 5,0,0)
	Goto See
  Pain.YellowPaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 6,0,0)
	Goto See
  Pain.BlackPaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 7,0,0)
	Goto See
  }
}


actor ArchShock
{
  Radius 1
  Height 1
  Speed 0
  Damage 0
  Projectile
  -RANDOMIZE
  +NOCLIP
  RenderStyle Add
  Alpha 0.85
  scale 0.6
  States
  {
  Spawn:
    FX16 FGHIJKL 4 bright A_FadeOut(0.02)
    stop
  }
}
actor SSTArchvileFire : Archvilefire replaces ArchvileFire
{
  Game Doom
  SpawnID 98
  RenderStyle Add
  Alpha 0.75
  +NOBLOCKMAP
  +NOGRAVITY
  +FIREDAMAGE
  States
  {
  Spawn:
    FIRE A 2 bright A_StartFire
	TNT1 AAA 0 A_SpawnItemEx ("RagDollSmoke", 0,0,16, random(-2,2),random(-2,2),random(-2,2), 0, 160)  
    FIRE BAB 2 bright A_Fire
    FIRE C 2 bright A_FireCrackle
	TNT1 AAAA 0 A_SpawnItemEx ("RagDollSmoke", 0,0,16, random(-2,2),random(-2,2),random(-2,2), 0, 160)  
    FIRE BCBCDCDCDEDED 2 bright A_Fire
    FIRE E 2 bright A_FireCrackle
	TNT1 AAAAA 0 A_SpawnItemEx ("RagDollSmoke", 0,0,16, random(-2,2),random(-2,2),random(-2,2), 0, 160)  
    FIRE FEFEFGHGHGH 2 bright A_Fire
	TNT1 A 35
    Stop
  Death:
	TNT1 A 0
	NULL A 0 A_SpawnItemEx ("YellowParticleShroom", 0,0,0, 0,0,0, 0, 160) 
	NULL A 0 A_SpawnItemEx ("BarrelExplosion3", 0,0,0, 0,0,0, 0, 160) 
	Stop
  }
}
actor VileFireBoom : SSTArchvilefire
{
  States
  {
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_Die
    Goto Death
  }
}