ACTOR Archvile_2 : Archvile
{
  Game Doom
  Health 750
  Radius 20
  Height 56
  Mass 500
  Speed 14
  Scale 0.97
  PainChance 10
  PainChance "Sniper", 50
  PainChance "Shotgungib", 9
  PainChance "Shotgun", 6
  PainChance "Fire", 4
  PainChance "Dragon", 2
  PainChance "DragonF", 2
  PainChance "Dragonsplosion", 2
  PainChance "RGAFire", 2
  PainChance "Knife", 95
  PainChance "Explosion", 255
  PainChance "ExplosionF", 255
  PainChance "ExplosionC", 255
  PainChance "NormalExplode", 255
  PainChance "Stun", 255
  PainChance "Stun2", 255
  PainChance "Stun3", 255
  PainChance "SewUpYou", 15
  PainChance "BuildFriendDamage", 15
  PainChance "ISABELLESROMANTICLOVE", 15
  Monster
  MaxTargetRange 896
  +QUICKTORETALIATE
  +FLOORCLIP
  +NOTARGET
  +DONTHARMSPECIES
  SeeSound "vile/sight"
  PainSound "vile/pain"
  DeathSound "vile/death"
  ActiveSound "vile/active"
  MeleeSound "vile/Stop"
  Obituary "%o was incinerated by an archvile."
  DamageFactor "RGABullet", 1.3
  DamageFactor "Shotgungib", 1.0
  DamageFactor "Shotgun", 1.0
  DamageFactor "Rifle", 1.45
  DamageFactor "LMG", 1.8
  DamageFactor "BigPistol", 1.9
  DamageFactor "Cyber", 1.9
  DamageFactor "Stun", 1.2
  DamageFactor "Stun2", 1.2
  DamageFactor "Stun3", 1.2
  DamageFactor "BarrelBoom", 2.0
  DamageFactor "ScriptedMarine", 0.6
  DamageFactor "Step", 10.0
  DamageFactor "Revive", 0.0
  DamageFactor "Fire", 0.68//0.36
  DamageFactor "Explosion", 2.0
  DamageFactor "ExplosionF", 2.0
  DamageFactor "ExplosionC", 2.0
  DamageFactor "NormalExplode", 1.4
  DamageFactor "Dragon", 0.36
  DamageFactor "DragonF", 0.45
  DamageFactor "Dragonsplosion", 0.3
  DamageFactor "RGAFire", 0.68//0.36
  DamageFactor "Sniper", 1.85
  DamageFactor "Knife", 1.65
  DamageFactor "BuildFriendDamage", 1.2
  DamageFactor "SewUpYou", 1.2
  //DropItem "Soulsphere3" 136
  Tag "Archvile"
  Species "Archviles"
  States
  {
  Spawn:
    VILE A 0
    VILE A 0 A_CheckFlag("Friendly",2)
    VILE A 0 Thing_SetSpecial(0,226,613,0,random(75,100))
    VILE A 20
  Idle:
    VILE AB 10 A_Look
    Loop
  See2:
    DVIL A 0 A_JumpIfInventory("BlindCheck",2,"See2Weak")
    VILE AABBCC 2 A_Chase("","")
    VILE DDEEFF 2 A_VileChase
  See:
    VILE A 0 A_JumpIfInventory("BlindCheck",2,"SeeWeak")
    VILE AABBCCDDEEFFAABBCCDDEEFF 2 A_VileChase
    VILE AABBCCDDEEFFAABBCCDDEEFF 2 A_VileChase
    VILE F 0 A_SpawnItemEx("ZombieStepDamage",0,0,28,0,0,0,0,0,0)
    Loop
  See2Weak:
    VILE AABBCC 3 A_Wander
    VILE DDEEFF 3 A_Chase("","")
	Goto See
  SeeWeak:
    VILE AABBCCDDEEFF 3 A_Chase
    VILE A 0 A_JumpIfInventory("BlindCheck",2,"SeeWeakCont")
	goto See+13
  SeeWeakCont:
    VILE AABBCCDDEEFF 3 A_VileChase
    VILE A 0 A_JumpIfInventory("BlindCheck",2,1)
	goto See+25
    VILE AABBCCDDEEFF 3 A_VileChase
    VILE F 0 A_SpawnItemEx("ZombieStepDamage",0,0,28,0,0,0,0,0,0)
    VILE A 0 A_JumpIfInventory("BlindCheck",2,"SeeWeakCont")
    goto See+37
  Missile:
    VILE G 0
    VILE G 0 A_VileStart
    VILE G 0 A_Jump(215,3)//4
    VILE G 0 A_JumpIf((ACS_NamedExecuteWithResult("RefCheckVar",4,0,0)) == 1, 3)
    VILE G 0 A_CheckFlag("Boss","Missile3")
    //VILE G 0 A_JumpIf((ACS_NamedExecuteWithResult("RefCheckVar",3,0,0)) == 1, "Missile3")
    VILE G 0 A_Jump(143,2)
    VILE G 0 A_JumpIfCloser(302,"Missile2")
    VILE G 10 BRIGHT A_FaceTarget
    VILE H 0 BRIGHT A_FaceTarget
    VILE H 8 BRIGHT A_VileTarget("VileSpikeFire")
    VILE IJKLMN 8 BRIGHT A_FaceTarget
    VILE O 0 BRIGHT A_FaceTarget
    VILE O 8 BRIGHT A_VileAttack("vile/Stop",15,50,70,1.5,"Fire")
    VILE PP 10 BRIGHT
    Goto See2
  Missile2:
    VILE LLMK 6 BRIGHT A_FaceTarget
    VILE N 0 BRIGHT A_FaceTarget
    VILE NNOO 1 BRIGHT A_CustomMissile("VileFlamerFire",36,0,random(-1000,1000)/100.00)
    VILE N 0 BRIGHT A_FaceTarget
    VILE NNOO 1 BRIGHT A_CustomMissile("VileFlamerFire",36,0,random(-1000,1000)/100.00)
    VILE N 0 BRIGHT A_FaceTarget
    VILE NO 2 BRIGHT A_CustomMissile("VileFlamerFire",36,0,random(-1000,1000)/100.00)
    VILE N 0 BRIGHT A_FaceTarget
    VILE NO 2 BRIGHT A_CustomMissile("VileFlamerFire",36,0,random(-1000,1000)/100.00)
    VILE N 0 BRIGHT A_FaceTarget
    VILE NO 2 BRIGHT A_CustomMissile("VileFlamerFire",36,0,random(-1000,1000)/100.00)
    VILE ON 5 BRIGHT A_FaceTarget
    Goto See2
  Missile3:
    VILE G 10 BRIGHT A_FaceTarget
    VILE IJKLMN 8 BRIGHT A_FaceTarget
    VILE O 0 BRIGHT A_FaceTarget
    VILE O 0 BRIGHT A_PlaySound("brain/spit")
    VILE O 0 BRIGHT A_SpawnItemEx("StoneKnightCube",8,0,28,8,0,0,-18,SXF_SETMASTER)
    VILE O 0 BRIGHT A_SpawnItemEx("BruiserCube",8,0,28,8,0,0,0,SXF_SETMASTER)
    VILE O 8 BRIGHT A_SpawnItemEx("StoneKnightCube",8,0,28,8,0,0,18,SXF_SETMASTER)
    VILE P 20 BRIGHT
    goto See2
  Heal:
    VILE "[\]" 11 BRIGHT
    Goto See2
  Pain.NormalExplode:
  Pain.Sniper:
  Pain.ExplosionF:
  Pain.ExplosionC:
  Pain.Explosion:
    VILE Q 5
    VILE Q 15 A_Pain
    Goto See2
  Pain.Stun3:
    VILE Q 0 ACS_NamedExecuteAlways("RefStun",0,2,0,0)
	goto Pain
  Pain.Stun2:
    VILE Q 0 ACS_NamedExecuteAlways("RefStun",0,1,0,0)
	goto Pain
  Pain.Stun:
    VILE Q 0 ACS_NamedExecuteAlways("RefStun",0,0,0,0)
	goto Pain
  Pain:
    VILE Q 5
    VILE Q 5 A_Pain
    Goto See2
  Pain.Knife:
    VILE Q 3
    VILE Q 3 A_Pain
    Goto See2
  Death:
    VILE Q 7
    VILE R 7 A_Scream
    VILE S 7 A_NoBlocking
    VILE TUVWXY 7 A_SpawnItemEx("ArmorBonus_3",0,0,0,random(-2,2),random(-2,2),random(2,5),0,0,0)
    //VILE Z 0 A_JumpIf((ACS_NamedExecuteWithResult("RefCheckVar",3,0,0)) == 1, 2)
    VILE Z -1
    Stop
    VILE ZZZZZZ 5250
    VILE ZZZZZZZZZ 2 A_FadeOut(0.1)
    Stop
  Death.Ice:
    "####" # 0 A_SpawnItemEx("ArmorBonus_3",0,0,0,random(-2,2),random(-2,2),random(2,5),0,0,0)
    "####" # 0 A_SpawnItemEx("ArmorBonus_3",0,0,0,random(-2,2),random(-2,2),random(2,5),0,0,0)
    "####" # 0 A_SpawnItemEx("ArmorBonus_3",0,0,0,random(-2,2),random(-2,2),random(2,5),0,0,0)
    "####" # 0 A_SpawnItemEx("ArmorBonus_3",0,0,0,random(-2,2),random(-2,2),random(2,5),0,0,0)
    "####" # 0 A_SpawnItemEx("ArmorBonus_3",0,0,0,random(-2,2),random(-2,2),random(2,5),0,0,0)
    "####" # 0 A_SpawnItemEx("ArmorBonus_3",0,0,0,random(-2,2),random(-2,2),random(2,5),0,0,0)
    "####" # 5 A_GenericFreezeDeath
    "----" A 1 A_FreezeDeathChunks
    wait
  }
}

actor VileSpikeFire : ArchvileFire
{
  States
  {
  Spawn:
    TNT1 A 0
    TNT1 A 2 A_StartFire
    TNT1 AAA 0 A_SpawnItemEx("FireFlare2", random(-4,4), random(-4,4), random(0,16), random(-2,2), random(-2,2), random(-1,4), 0, 128, 96)
    TNT1 A 2 A_Fire
    TNT1 AAA 0 A_SpawnItemEx("FireFlare2", random(-4,4), random(-4,4), random(0,16), random(-2,2), random(-2,2), random(-1,4), 0, 128, 96)
    TNT1 A 2 A_Fire
    TNT1 AAA 0 A_SpawnItemEx("FireFlare2", random(-4,4), random(-4,4), random(0,16), random(-2,2), random(-2,2), random(-1,4), 0, 128, 96)
    TNT1 A 2 A_Fire
    TNT1 AAA 0 A_SpawnItemEx("FireFlare2", random(-4,4), random(-4,4), random(0,16), random(-2,2), random(-2,2), random(-1,4), 0, 128, 96)
    TNT1 A 2 A_FireCrackle
    TNT1 AAA 0 A_SpawnItemEx("FireFlare2", random(-4,4), random(-4,4), random(8,24), random(-2,2), random(-2,2), random(-1,4), 0, 128, 96)
    TNT1 A 2 A_Fire
    TNT1 AAA 0 A_SpawnItemEx("FireFlare2", random(-4,4), random(-4,4), random(8,24), random(-2,2), random(-2,2), random(-1,4), 0, 128, 96)
    TNT1 A 2 A_Fire
    TNT1 AAA 0 A_SpawnItemEx("FireFlare2", random(-4,4), random(-4,4), random(8,24), random(-2,2), random(-2,2), random(-1,4), 0, 128, 96)
    TNT1 A 2 A_Fire
    TNT1 AAA 0 A_SpawnItemEx("FireFlare2", random(-4,4), random(-4,4), random(8,24), random(-2,2), random(-2,2), random(-1,4), 0, 128, 96)
    TNT1 A 2 A_Fire
    TNT1 AAA 0 A_SpawnItemEx("FireFlare2", random(-4,4), random(-4,4), random(8,24), random(-2,2), random(-2,2), random(-1,4), 0, 128, 96)
    TNT1 A 2 A_Fire
    TNT1 AAA 0 A_SpawnItemEx("FireFlare2", random(-4,4), random(-4,4), random(16,32), random(-2,2), random(-2,2), random(-1,4), 0, 128, 96)
    TNT1 A 2 A_Fire
    TNT1 AAA 0 A_SpawnItemEx("FireFlare2", random(-4,4), random(-4,4), random(16,32), random(-2,2), random(-2,2), random(-1,4), 0, 128, 96)
    TNT1 A 2 A_Fire
    TNT1 AAA 0 A_SpawnItemEx("FireFlare2", random(-4,4), random(-4,4), random(16,32), random(-2,2), random(-2,2), random(-1,4), 0, 128, 96)
    TNT1 A 2 A_Fire
    TNT1 AAA 0 A_SpawnItemEx("FireFlare2", random(-4,4), random(-4,4), random(16,32), random(-2,2), random(-2,2), random(-1,4), 0, 128, 96)
    TNT1 A 2 A_Fire
    TNT1 AAA 0 A_SpawnItemEx("FireFlare2", random(-4,4), random(-4,4), random(16,32), random(-2,2), random(-2,2), random(-1,4), 0, 128, 96)
    TNT1 A 2 A_Fire
    TNT1 AAA 0 A_SpawnItemEx("FireFlare2", random(-4,4), random(-4,4), random(24,40), random(-2,2), random(-2,2), random(-1,4), 0, 128, 96)
    TNT1 A 2 A_Fire
    TNT1 AAA 0 A_SpawnItemEx("FireFlare2", random(-4,4), random(-4,4), random(24,40), random(-2,2), random(-2,2), random(-1,4), 0, 128, 96)
    TNT1 A 2 A_Fire
    TNT1 AAA 0 A_SpawnItemEx("FireFlare2", random(-4,4), random(-4,4), random(24,40), random(-2,2), random(-2,2), random(-1,4), 0, 128, 96)
    TNT1 A 2 A_Fire
    TNT1 AAA 0 A_SpawnItemEx("FireFlare2", random(-4,4), random(-4,4), random(24,40), random(-2,2), random(-2,2), random(-1,4), 0, 128, 96)
    TNT1 A 2 A_FireCrackle
    TNT1 AAA 0 A_SpawnItemEx("FireFlare2", random(-4,4), random(-4,4), random(24,40), random(-2,2), random(-2,2), random(-1,4), 0, 128, 96)
    TNT1 A 2 A_Fire
    TNT1 AAA 0 A_SpawnItemEx("FireFlare2", random(-4,4), random(-4,4), random(32,48), random(-2,2), random(-2,2), random(-1,4), 0, 128, 96)
    TNT1 A 2 A_Fire
    TNT1 AAA 0 A_SpawnItemEx("FireFlare2", random(-4,4), random(-4,4), random(32,48), random(-2,2), random(-2,2), random(-1,4), 0, 128, 96)
    TNT1 A 2 A_Fire
    TNT1 AAA 0 A_SpawnItemEx("FireFlare2", random(-4,4), random(-4,4), random(32,48), random(-2,2), random(-2,2), random(-1,4), 0, 128, 96)
    TNT1 A 2 A_Fire
    TNT1 AAA 0 A_SpawnItemEx("FireFlare2", random(-4,4), random(-4,4), random(32,48), random(-2,2), random(-2,2), random(-1,4), 0, 128, 96)
    TNT1 A 2 A_Fire
    TNT1 AAA 0 A_SpawnItemEx("FireFlare2", random(-4,4), random(-4,4), random(32,48), random(-2,2), random(-2,2), random(-1,4), 0, 128, 96)
    TNT1 A 2 A_Fire
    TNT1 AA 0 A_SpawnItemEx("FireFlare2", random(-4,4), random(-4,4), random(40,56), random(-2,2), random(-2,2), random(-1,4), 0, 128, 64)
    TNT1 A 2 A_Fire
    TNT1 AA 0 A_SpawnItemEx("FireFlare2", random(-4,4), random(-4,4), random(40,56), random(-2,2), random(-2,2), random(-1,4), 0, 128, 64)
    TNT1 A 2 A_Fire
    TNT1 AA 0 A_SpawnItemEx("FireFlare2", random(-4,4), random(-4,4), random(40,56), random(-2,2), random(-2,2), random(-1,4), 0, 128, 64)
    TNT1 A 2 A_Fire
    TNT1 AA 0 A_SpawnItemEx("FireFlare2", random(-4,4), random(-4,4), random(40,56), random(-2,2), random(-2,2), random(-1,4), 0, 128, 64)
    TNT1 A 2 A_Fire
    TNT1 AA 0 A_SpawnItemEx("FireFlare2", random(-4,4), random(-4,4), random(40,56), random(-2,2), random(-2,2), random(-1,4), 0, 128, 64)
    TNT1 A 12 A_Fire
    Stop
  }
}

actor VileFlamerFire : FlameThrowerFire
{
  Speed 13
  Scale 0.6
  Damagetype "RGAFire"
  States
  {
  Spawn:
    FLMD A 0
    FLMD A 0 A_ScaleVelocity(frandom(0.95,1.05))
    FLMD A 1
    FLMD A 2 A_Explode(7,80,0)
    FLMD A 0 BRIGHT A_Explode(7,72,0)
    FLMD A 1 BRIGHT A_FadeIn(0.13)
    FLMD AA 1 BRIGHT A_FadeIn(0.15)
    FLMD B 0 BRIGHT A_Explode(7,64,0)
    FLMD BBB 1 BRIGHT A_FadeIn(0.12)
    FLMD CDEFG 3 BRIGHT A_Explode(7,64,0)
    FLMD H 0 BRIGHT A_Explode(6,56,0)
    FLMD HH 2 BRIGHT A_FadeOut(0.1)
    FLMD I 0 BRIGHT A_Explode(5,48,0)
    FLMD II 2 BRIGHT A_FadeOut(0.15)
    FLMD J 0 BRIGHT A_Explode(4,40,0)
    FLMD J 3 BRIGHT A_FadeOut(0.15)
    TNT1 A 15 BRIGHT A_ScaleVelocity(0)
    Stop
  }
}

//Cheers to whoever made the black Archvile from insanmons.wad
actor Deathvile : Archvile_2
{
  Obituary "%o was obliterated by a deathvile."
  Health 1100//1200
  Radius 20
  Height 56
  Mass 500
  Speed 12
  Scale 1.02
  SeeSound "vile2/sight"
  PainSound "vile2/pain"
  DeathSound "vile2/death"
  ActiveSound "vile/active"
  MONSTER
  +FLOORCLIP
  +NOTARGET
  +QUICKTORETALIATE
  MaxTargetRange 1216//1536
  DamageFactor "Fire", 0.68//0.36
  DamageFactor "Explosion", 2.0
  DamageFactor "ExplosionF", 2.0
  DamageFactor "ExplosionC", 2.0
  DamageFactor "NormalExplode", 1.4
  DamageFactor "Dragon", 0.36
  DamageFactor "DragonF", 0.45
  DamageFactor "Dragonsplosion", 0.3
  DamageFactor "RGAFire", 0.68//0.36
  DamageFactor "Sniper", 1.85
  DamageFactor "Knife", 1.65
  DamageFactor "BuildFriendDamage", 1.2
  DamageFactor "SewUpYou", 1.2
  //DropItem "Soulsphere3" 176
  Tag "Deathvile"
  States
  {
  Spawn:
    DVIL A 0
    DVIL A 0 A_CheckFlag("Friendly",2)
    DVIL A 0 Thing_SetSpecial(0,226,613,0,random(90,120))
    DVIL A 20
  Idle:
    DVIL AB 10 A_Look
    Loop
  See2:
    DVIL A 0 A_JumpIfInventory("BlindCheck",3,"See2Weak")
    DVIL AABBCC 2 A_Chase("","")
    DVIL DDEEFF 2 A_VileChase
  See:
    DVIL A 0 A_JumpIfInventory("BlindCheck",3,"SeeWeak")
    DVIL AABBCCDDEEFFAABBCCDDEEFF 2 A_VileChase
    DVIL AABBCCDDEEFFAABBCCDDEEFF 2 A_VileChase
    DVIL F 0 A_SpawnItemEx("ZombieStepDamage",0,0,28,0,0,0,0,0,0)
    loop
  See2Weak:
    DVIL AABBCC 3 A_Wander
    DVIL DDEEFF 3 A_Chase("","")
	Goto See
  SeeWeak:
    DVIL AABBCCDDEEFF 3 A_Chase
    DVIL A 0 A_JumpIfInventory("BlindCheck",3,"SeeWeakCont")
	goto See+13
  SeeWeakCont:
    DVIL AABBCCDDEEFF 3 A_VileChase
    DVIL A 0 A_JumpIfInventory("BlindCheck",3,1)
	goto See+25
    DVIL AABBCCDDEEFF 3 A_VileChase
    DVIL F 0 A_SpawnItemEx("ZombieStepDamage",0,0,28,0,0,0,0,0,0)
    DVIL A 0 A_JumpIfInventory("BlindCheck",3,"SeeWeakCont")
    goto See+37
  Missile:
    DVIL G 0
    DVIL G 0 A_VileStart
    DVIL G 0 A_Jump(215,3)//4
    DVIL G 0 A_JumpIf((ACS_NamedExecuteWithResult("RefCheckVar",4,0,0)) == 1, 3)
    DVIL G 0 A_CheckFlag("Boss","Missile4Alt")
    //DVIL G 0 A_JumpIf((ACS_NamedExecuteWithResult("RefCheckVar",3,0,0)) == 1, "Missile4Alt")
    DVIL G 0 A_Jump(159,2)
    DVIL G 0 A_JumpIfCloser(896,"Missile2")
    DVIL G 0 A_Jump(159,2)
    DVIL G 0 A_JumpIfCloser(302,"Missile3")
    DVIL G 10 BRIGHT A_FaceTarget
    DVIL H 8 BRIGHT A_FaceTarget
    DVIL H 0 BRIGHT A_JumpIf((ACS_NamedExecuteWithResult("RefCheckVar",4,0,0)) == 1, "MissileCont")
    DVIL H 0 BRIGHT A_JumpIfInventory("BreathWait",7,"MissileCont")
    DVIL H 0 BRIGHT A_Jump(20,"Missile4")
  MissileCont:
    DVIL H 0 BRIGHT A_PlaySound("weapons/bfgf2")
    DVIL IJKLMN 8 BRIGHT A_FaceTarget
    DVIL O 0 BRIGHT A_FaceTarget
    DVIL O 8 BRIGHT A_CustomMissile("DeathvileBFGBall",48)
    DVIL P 20 BRIGHT
    goto See2
  Missile2:
    DVIL G 9 BRIGHT A_FaceTarget
    DVIL H 0 BRIGHT A_FaceTarget
    DVIL H 7 BRIGHT A_VileTarget("VileSpikeFire")
    DVIL IJKLMN 7 BRIGHT A_FaceTarget
    DVIL O 0 BRIGHT A_FaceTarget
    DVIL O 7 BRIGHT A_VileAttack("vile/Stop",15,50,70,1.5,"Fire")
    DVIL PP 9 BRIGHT
    Goto See2
  Missile3:
    DVIL LLMK 6 BRIGHT A_FaceTarget
    DVIL N 0 BRIGHT A_FaceTarget
    DVIL NNOO 1 BRIGHT A_CustomMissile("VileFlamerFire",36,0,random(-1375,1375)/100.00)
    DVIL N 0 BRIGHT A_FaceTarget
    DVIL NNOO 1 BRIGHT A_CustomMissile("VileFlamerFire",36,0,random(-1375,1375)/100.00)
    DVIL N 0 BRIGHT A_FaceTarget
    DVIL NN 1 BRIGHT A_CustomMissile("VileFlamerFire",36,0,random(-1375,1375)/100.00)
    DVIL O 2 BRIGHT A_CustomMissile("VileFlamerFire",36,0,random(-1375,1375)/100.00)
    DVIL N 0 BRIGHT A_FaceTarget
    DVIL NO 2 BRIGHT A_CustomMissile("VileFlamerFire",36,0,random(-1375,1375)/100.00)
    DVIL N 0 BRIGHT A_FaceTarget
    DVIL NO 2 BRIGHT A_CustomMissile("VileFlamerFire",36,0,random(-1375,1375)/100.00)
    DVIL N 0 BRIGHT A_FaceTarget
    DVIL NO 2 BRIGHT A_CustomMissile("VileFlamerFire",36,0,random(-1375,1375)/100.00)
    DVIL ON 5 BRIGHT A_FaceTarget
    Goto See2
  Missile4:
    DVIL IJKLMN 8 BRIGHT A_FaceTarget
    DVIL O 0 BRIGHT A_FaceTarget
    DVIL O 0 BRIGHT A_PlaySound("brain/spit")
    DVIL O 0 BRIGHT A_GiveInventory("BreathWait",3) 
    DVIL O 0 BRIGHT A_SpawnItemEx("StoneKnightCube",8,0,28,8,0,0,-18,SXF_SETMASTER)
    DVIL O 0 BRIGHT A_SpawnItemEx("BruiserCube",8,0,28,8,0,0,0,SXF_SETMASTER)
    DVIL O 8 BRIGHT A_SpawnItemEx("StoneKnightCube",8,0,28,8,0,0,18,SXF_SETMASTER)
    DVIL P 20 BRIGHT
    goto See2
  Missile4Alt:
    DVIL GHIJKLMN 7 BRIGHT A_FaceTarget
    DVIL O 0 BRIGHT A_FaceTarget
    DVIL O 0 BRIGHT A_PlaySound("brain/spit")
    DVIL O 0 BRIGHT A_SpawnItemEx("StoneKnightCube",8,0,28,8,0,0,-27,SXF_SETMASTER)
    DVIL O 0 BRIGHT A_SpawnItemEx("BruiserCube",8,0,28,8,0,0,-9,SXF_SETMASTER)
    DVIL O 0 BRIGHT A_SpawnItemEx("BruiserCube",8,0,28,8,0,0,9,SXF_SETMASTER)
    DVIL O 7 BRIGHT A_SpawnItemEx("StoneKnightCube",8,0,28,8,0,0,27,SXF_SETMASTER)
    DVIL P 18 BRIGHT
    goto See2
  Heal:
    DVIL G 4 BRIGHT
    DVIL G 4 BRIGHT A_SpawnItemEx("DeathvileHealer",0,0,0,0,0,0,random(0,359),SXF_NOCHECKPOSITION|SXF_SETMASTER,0)
    DVIL H 8 BRIGHT A_SpawnItemEx("DeathvileHealer",0,0,0,0,0,0,random(0,359),SXF_NOCHECKPOSITION|SXF_SETMASTER,0)
    DVIL IHG 8 BRIGHT
    DVIL AA 3
    DVIL BBCCD 3 A_Chase("","")
    DVIL DEEFF 3 A_Chase
    goto See2
  Pain.NormalExplode:
  Pain.Sniper:
  Pain.ExplosionF:
  Pain.ExplosionC:
  Pain.Explosion:
    DVIL Q 5
    DVIL Q 15 A_Pain
    Goto See2
  Pain.Stun3:
    DVIL Q 0 ACS_NamedExecuteAlways("RefStun",0,2,0,0)
	goto Pain
  Pain.Stun2:
    DVIL Q 0 ACS_NamedExecuteAlways("RefStun",0,1,0,0)
	goto Pain
  Pain.Stun:
    DVIL Q 0 ACS_NamedExecuteAlways("RefStun",0,0,0,0)
	goto Pain
  Pain:
    DVIL Q 5
    DVIL Q 5 A_Pain
    goto See2
  Pain.Knife:
    DVIL Q 3
    DVIL Q 3 A_Pain
    goto See2
  Death:
    SPID I 0 A_GiveToTarget("RandomKillstreakRare",1)
    DVIL Q 7
    DVIL R 7 A_Scream
    DVIL S 7 A_NoBlocking
    DVIL TUVW 7 A_SpawnItemEx("ArmorBonus_3",0,0,0,random(-2,2),random(-2,2),random(2,5),0,0,0)
    DVIL X 5 A_SpawnItemEx("ArmorBonus_3",0,0,0,random(-2,2),random(-2,2),random(2,5),0,0,0)
    DVIL XYY 2 A_SpawnItemEx("ArmorBonus_3",0,0,0,random(-2,2),random(-2,2),random(2,5),0,0,0)
    DVIL Y 3 A_SpawnItemEx("ArmorBonus_3",0,0,0,random(-2,2),random(-2,2),random(2,5),0,0,0)
    //DVIL Z 0 A_JumpIf((ACS_NamedExecuteWithResult("RefCheckVar",3,0,0)) == 1, 2)
    DVIL Z -1
    Stop
    DVIL ZZZZZZ 5250
    DVIL ZZZZZZZZZ 2 A_FadeOut(0.1)
    Stop
  Death.Ice:
    "####" # 0 A_GiveToTarget("RandomKillstreakRare",1)
    "####" # 0 A_SpawnItemEx("ArmorBonus_3",0,0,0,random(-2,2),random(-2,2),random(2,5),0,0,0)
    "####" # 0 A_SpawnItemEx("ArmorBonus_3",0,0,0,random(-2,2),random(-2,2),random(2,5),0,0,0)
    "####" # 0 A_SpawnItemEx("ArmorBonus_3",0,0,0,random(-2,2),random(-2,2),random(2,5),0,0,0)
    "####" # 0 A_SpawnItemEx("ArmorBonus_3",0,0,0,random(-2,2),random(-2,2),random(2,5),0,0,0)
    "####" # 0 A_SpawnItemEx("ArmorBonus_3",0,0,0,random(-2,2),random(-2,2),random(2,5),0,0,0)
    "####" # 0 A_SpawnItemEx("ArmorBonus_3",0,0,0,random(-2,2),random(-2,2),random(2,5),0,0,0)
    "####" # 0 A_SpawnItemEx("ArmorBonus_3",0,0,0,random(-2,2),random(-2,2),random(2,5),0,0,0)
    "####" # 0 A_SpawnItemEx("ArmorBonus_3",0,0,0,random(-2,2),random(-2,2),random(2,5),0,0,0)
    "####" # 5 A_GenericFreezeDeath
    "----" A 1 A_FreezeDeathChunks
    wait
  }
}

actor DeathvileBFGBall
{
  RenderStyle Add
  alpha 0.95
  Radius 10
  Height 8
  Speed 15
  Damage (50)
  SeeSound "bfg/fire1"
  DeathSound "bfg/explode1"
  PROJECTILE
  +EXTREMEDEATH
  +FORCERADIUSDMG
  +SKYEXPLODE
  +FORCEXYBILLBOARD
  Decal BFGLightning
  Scale 0.2
  DamageType "NormalExplode"//"Fire"
  States
  {
  Spawn:
	BFG2 AAAAAAAAAA 1 BRIGHT A_SpawnItemEx("ImpactSpark2BGreen", -2, random(-4,4), random(-4,4), random(-3,-1), random(-2,2), random(-2,2), 0, 128, 64)
	BFG2 A 0 BRIGHT A_Explode(3,322,0)
	loop
  Death:
	TNT1 A 0 A_RadiusThrust(160,128,RTF_NOIMPACTDAMAGE)
	TNT1 A 0 Radius_Quake(4,15,0,40,0)
	TNT1 A 0 A_SpawnItemEx("VileBFGBoom", 0, 0, 0, 0, 0, 0, 0, 128, 0)
	TNT1 A 0 A_PlaySoundEx("distant/explosion","SoundSlot5")
	TNT1 AAAAAAAAAA 0 A_SpawnItemEx("ImpactSpark2BGreen", random(-32,32), random(-32,32), random(-16,24), random(-5,5), random(-5,5), random(-3,4), 0, 128, 0)
	TNT1 AAAAAAAAAA 0 A_SpawnItemEx("ImpactSpark2BGreen", random(-32,32), random(-32,32), random(-16,24), random(-5,5), random(-5,5), random(-3,4), 0, 128, 0)
	TNT1 A 10 A_Explode(100,384,0)
    TNT1 A 15
	Stop
  }
}

actor VileBFGBoom
{
  RenderStyle Add
  alpha 0.9
  +NOCLIP
  +NOGRAVITY
  +FORCEXYBILLBOARD
  Scale 0.5
  States
  {
  Spawn:
    BFG3 BABCDE 5 BRIGHT
	TNT1 A 20
    Stop
  }
}

actor DeathvileHealer
{
  Alpha 0.2
  Scale 0.7
  Radius 20
  Height 56
  Speed 20
  Mass 10000
  Health 30000
  MONSTER
  +NOTARGET
  +LOOKALLAROUND
  +INVULNERABLE
  +NEVERRESPAWN
  -SHOOTABLE
  -SOLID
  -ISMONSTER
  -COUNTKILL
  Renderstyle Translucent
  States
  {
  Spawn:
    VILE A 0 A_JumpIfInventory("LastStandHP",5,"Die")
    VILE A 0 A_ClearTarget
	VILE A 0 A_SetAngle(angle+random(-450,450))
    VILE AABBCC 2 A_Wander
    VILE D 0 A_GiveInventory("LastStandHP",1)
    VILE D 0 A_JumpIfInventory("LastStandHP",5,"Die2")
	VILE D 0 A_SetAngle(angle+random(-45,45))
    VILE DDEEFF 2 A_VileChase
    VILE A 0 A_GiveInventory("LastStandHP",1)
    VILE A 0 A_JumpIfInventory("LastStandHP",5,"Die")
	VILE A 0 A_SetAngle(angle+random(-45,45))
    VILE AABBCC 2 A_VileChase
    VILE D 0 A_GiveInventory("LastStandHP",1)
    VILE D 0 A_JumpIfInventory("LastStandHP",5,"Die2")
	VILE D 0 A_SetAngle(angle+random(-45,45))
    VILE DDEEFF 2 A_VileChase
    VILE A 0 A_GiveInventory("LastStandHP",1)
    VILE A 0 A_JumpIfInventory("LastStandHP",5,"Die")
	VILE A 0 A_SetAngle(angle+random(-45,45))
    VILE AABBCC 2 A_VileChase
    VILE D 0 A_GiveInventory("LastStandHP",1)
    VILE D 0 A_JumpIfInventory("LastStandHP",5,"Die2")
	VILE D 0 A_SetAngle(angle+random(-45,45))
    VILE DDEEFF 2 A_VileChase
  Die:
    VILE A 0 A_FadeOut(0.05)
    VILE A 0 A_TakeInventory("LastStandHP",50)
    VILE A 4 A_Wander
    VILE B 0 A_FadeOut(0.05)
    VILE B 4 A_Wander
    VILE C 0 A_FadeOut(0.05)
    VILE C 4 A_Wander
    VILE D 0 A_FadeOut(0.05)
    VILE D 4 A_Wander
    Stop
  Die2:
    VILE D 0 A_FadeOut(0.05)
    VILE D 0 A_TakeInventory("LastStandHP",50)
    VILE D 4 A_Wander
    VILE E 0 A_FadeOut(0.05)
    VILE E 4 A_Wander
    VILE F 0 A_FadeOut(0.05)
    VILE F 4 A_Wander
    VILE A 0 A_FadeOut(0.05)
    VILE A 4 A_Wander
    Stop
  Heal:
    VILE "[\]" 5
    VILE "[\]" 5 A_FadeOut(0.05)
    Stop
  }
}

actor Archvile_2Stealth : Archvile_2
{
  +STEALTH
  RenderStyle Translucent
  Alpha 0
}

ACTOR DeathvileStealth : Deathvile
{
  +STEALTH
  RenderStyle Translucent
  Alpha 0
}