/*
CREDITS:
Gun graphic & pickup - NMN\Paul Zarczynski
Sounds - There's many of them, but most of them are ID\Raven's job. Can't name those specific ones source. (Charge, slide, fireadd2)
Lightnings and fancy smoke, impact flare - Keksdose
Pulsing ring - Kronos
Giant purple ball - Raven Software
Black hole graphics - Zero Prophet
Lenin graphics - Zrrion the Insect

Recolors and lousy gun animation by me. I know that it sucks. D:
*/

actor Borsch : Weapon 24541
{
  //$Category Weapons
  //$Title Borsch
  //$Sprite LDGGX0
  Inventory.PickupSound "misc/w_pkup"
  Inventory.PickupMessage "You got a LDG-3 ''Borsch'' annihilation generator mark MLLCXXIX! Black holes and lightnings, this is crazy! (8)"
  obituary "%o was kinda sucked in and destabilized into single quarks, then compressed into a molecule by %k's ''Borsch''."
  Weapon.UpSound "Borsch/Up"
  Weapon.AmmoGive 100
  Weapon.AmmoType "VoidAmmo"
  Weapon.AmmoUse 10
  Weapon.AmmoType2 "VoidAmmo"
  Weapon.AmmoUse2 50
  weapon.KickBack 0
  Weapon.SlotNumber 8
  +NOAUTOFIRE
  states
  {
  Spawn:
	LDGG X -1
	loop
  Select:
  	LDGG A 1 A_Raise
  	Loop
  Deselect:
  	LDGG A 0 A_StopSound(5)
  	LDGG A 0 A_Lower
  	LDGG A 1 A_Lower
  	loop
  Ready:
  	LDGG A 0 A_PlaySound("Borsch/Idle",5,0.8,1)
  	LDGG A 1 A_WeaponReady
  	loop
  Fire:
    LDGG A 0 A_StopSound(5)
	LDGG A 0 A_GunFlash
	LDGG A 0 A_SetBlend("Purple",0.3,15)
    LDGG A 0 A_Recoil(10)
    LDGG A 0 A_PlaySound("Borsch/Fire",1)
    LDGG A 0 A_PlaySound("Borsch/Add1",5)
    LDGG A 0 A_FireCustomMissile("DarkWeave", 0, 1, 2, 3)
	
	LDGG A 0 A_SetPitch(pitch-3.5)
    LDGG A 0 A_SetAngle(angle-2)
	LDGF A 1 Bright Offset(26,58) A_ZoomFactor(0.975)
	LDGG A 0 A_SetPitch(pitch-2)
    LDGG A 0 A_SetAngle(angle-1.25)
	LDGF A 1 Bright Offset(20,52) A_ZoomFactor(0.925)
	LDGG A 0 A_SetPitch(pitch-0.5)
    LDGG A 0 A_SetAngle(angle-0.5)
	LDGF A 1 Bright Offset(16,48) A_ZoomFactor(0.9)
	LDGG A 0 A_SetPitch(pitch-0.25)
    LDGG A 0 A_SetAngle(angle-0.25)
	LDGF A 1 Bright Offset(13,45) A_ZoomFactor(0.925)
	LDGG A 1 Bright Offset(10,42) A_ZoomFactor(0.935)
	LDGG A 1 Bright Offset(8,40) A_ZoomFactor(0.945)
	LDGG A 1 Offset(6,38) A_ZoomFactor(0.95)
	LDGG A 1 Offset(4,36) A_ZoomFactor(0.96)
	LDGG A 1 Offset(2,34) A_ZoomFactor(0.97)
	LDGG A 1 Offset(1,33) A_ZoomFactor(0.98)
	LDGG A 1 A_ZoomFactor(0.99)
	LDGG A 4 A_ZoomFactor(1)
	LDGG A 20
   	Goto Ready
 AltFire:
   	LDGG A 0 A_JumpIfInventory("LeninActive",1,"GlobalOrangeJuiceMutilator")
    LDGG A 0 A_PlaySound("Borsch/Slide",6)
    LDGG A 0 A_Quake(2, 19, 0, 2,"none")
    LDGS ABCDEFGHI 1
    LDGC A 25
    LDGL H 0 A_StopSound(5)
	LDGL H 0 A_GunFlash
	LDGL H 0 A_SetBlend("Purple",0.9,25)
    LDGL H 0 A_Recoil(20)
    LDGL H 0 A_PlaySound("Borsch/Fire",1)
    LDGL H 0 A_PlaySound("Borsch/Add1",5)
    LDGL H 0 A_PlaySound("Borsch/Add2",6)
    LDGL H 0 A_FireCustomMissile("BorschHoleProjectile", 0, 1, 2, 3)
	
	LDGL H 0 A_SetPitch(pitch-5)
    LDGL H 0 A_SetAngle(angle-3)
	LDGC X 1 Bright Offset(26,58) A_ZoomFactor(0.8)
	LDGL H 0 A_SetPitch(pitch-3)
    LDGL H 0 A_SetAngle(angle-1.5)
	LDGC X 1 Bright Offset(20,52) A_ZoomFactor(0.825)
	LDGL H 0 A_SetPitch(pitch-0.5)
    LDGL H 0 A_SetAngle(angle-0.5)
	LDGC X 1 Bright Offset(16,48) A_ZoomFactor(0.85)
	LDGL H 0 A_SetPitch(pitch-0.25)
    LDGL H 0 A_SetAngle(angle-0.25)
	LDGC A 1 Bright Offset(13,45) A_ZoomFactor(0.9)
	LDGC A 1 Bright Offset(10,42) A_ZoomFactor(0.925)
	LDGC A 1 Bright Offset(8,40) A_ZoomFactor(0.95)
	LDGC A 1 Offset(6,38) A_ZoomFactor(0.96)
	LDGC A 1 Offset(4,36) A_ZoomFactor(0.97)
	LDGC A 1 Offset(2,34) A_ZoomFactor(0.98)
	LDGC A 1 Offset(1,33) A_ZoomFactor(0.99)
	LDGC A 5 A_ZoomFactor(1)
    LDGG A 0 A_PlaySound("Borsch/Slide",6)
	LDGS IHGFEDCBA 1
	LDGG A 10
   	Goto Ready
  GlobalOrangeJuiceMutilator:
    LDGG A 0 A_PlaySound("Borsch/Charge",5,0.9,1)
    LDGG A 0 A_PlaySound("Borsch/Slide",6)
    LDGG A 0 A_Quake(2, 19, 0, 2,"none")
    LDGS ABCDEFGHI 1
    LDGC A 10

    LDGG A 0 A_Quake(4, 36, 0, 2,"none")
	LDGC ABCDEF 6
	
    LDGG A 0 A_Quake(6, 52, 0, 2,"none")
	LDGL ABCDEFGH 4
	
    LDGL H 0 ACS_Execute(708)
	LDGL H 25
    LDGL H 0 A_StopSound(5)
	LDGL H 0 A_GunFlash
	LDGL H 0 A_SetBlend("Purple",0.9,35)
    LDGL H 0 A_Recoil(35)
    LDGL H 0 A_PlaySound("Borsch/Fire",1)
    LDGL H 0 A_PlaySound("Borsch/Add1",5)
    LDGL H 0 A_PlaySound("Borsch/Add2",6)
    LDGL H 0 A_PlaySound("Weapons/GuruAddFire",8)
	LDGG A 0 A_JumpIfInventory("InfiniteAmplifier",1,3)
    LDGG A 0 A_TakeInventory("Lenin",1)
    LDGG A 0 A_TakeInventory("LeninActive",1)
    LDGL H 0 A_FireCustomMissile("BorschHoleClusterProjectile", 0, 0, 2, 3)
	
	LDGL H 0 A_SetPitch(pitch-7)
    LDGL H 0 A_SetAngle(angle-4)
	LDGL I 1 Bright Offset(26,58) A_ZoomFactor(0.75)
	LDGL H 0 A_SetPitch(pitch-4)
    LDGL H 0 A_SetAngle(angle-2.5)
	LDGL I 1 Bright Offset(20,52) A_ZoomFactor(0.8)
	LDGL H 0 A_SetPitch(pitch-1)
    LDGL H 0 A_SetAngle(angle-1)
	LDGL I 1 Bright Offset(16,48) A_ZoomFactor(0.85)
	LDGL H 0 A_SetPitch(pitch-0.5)
    LDGL H 0 A_SetAngle(angle-0.5)
	LDGL I 1 Bright Offset(13,45) A_ZoomFactor(0.9)
	LDGL H 1 Bright Offset(10,42) A_ZoomFactor(0.925)
	LDGL H 1 Bright Offset(8,40) A_ZoomFactor(0.95)
	LDGL H 1 Offset(6,38) A_ZoomFactor(0.96)
	LDGL H 1 Offset(4,36) A_ZoomFactor(0.97)
	LDGL H 1 Offset(2,34) A_ZoomFactor(0.98)
	LDGL H 1 Offset(1,33) A_ZoomFactor(0.99)
	LDGL H 5 A_ZoomFactor(1)
	LDGL HGFEDCBA 3
	LDGC FEDCBA 1
	LDGC A 20
    LDGG A 0 A_PlaySound("Borsch/Slide",6)
	LDGS IHGFEDCBA 1
	LDGG A 10
   	Goto Ready
  Flash:
    TNT1 A 12 bright A_Light2
    TNT1 A 4 bright A_Light1
    TNT1 A 0 bright A_Light0
    stop
  AltFlash:
    TNT1 A 8 bright A_Light2
    TNT1 A 4 bright A_Light1
    TNT1 A 0 bright A_Light0
    stop
  }
}

//CLUSTER BLACKHOLE

actor LeninPickup : CustomInventory
{
	Inventory.PickupMessage "Picked up a ''Lenin'' black hole amplifier!"
	Inventory.PickupSound "Ammo/Lenin"
	States
	{
		Spawn:
		HOLE ABCDEFGHIJ 2
		Loop
		Pickup:
		TNT1 A 0 A_JumpIfInventory("Lenin",0,"Bailure")
		TNT1 A 0 A_GiveInventory("Lenin")
		Stop
		Bailure:
		TNT1 A 1
		Fail
	}
}

actor Lenin : CustomInventory
{
  Inventory.PickupMessage "Picked up a ''Lenin'' black hole amplifier!"
  Inventory.Amount 1
  Inventory.MaxAmount 2
  Inventory.InterHubAmount 2
  Inventory.PickupSound "Ammo/Lenin"
  Inventory.Icon ARTIHOLE
  +INVENTORY.FANCYPICKUPSOUND
  +INVBAR
  states
  {
  Spawn:
	HOLE ABCDEFGHIJ 2
	loop
  Use:
   	TNT1 A 0 A_JumpIfInventory("LeninActive",1,"Use2")

	TNT1 A 0 A_SetBlend("Green",0.1,15)
	TNT1 A 0 A_PlaySoundEx("Lenin/Active","Item")
	TNT1 A 0 A_GiveInventory("LeninActive")
	TNT1 A 1 A_Print("Black hole amplifier activated.")
	Fail
  Use2:
	TNT1 A 0 A_SetBlend("Red",0.1,15)
	TNT1 A 0 A_PlaySoundEx("Lenin/Inactive","Item")
 	TNT1 A 0 A_TakeInventory("LeninActive")
	TNT1 A 1 A_Print("Black hole amplifier deactivated.")
	Fail
  }
}

actor LeninActive : Inventory
{
  Inventory.MaxAmount 1
}

//INHERITANCE

ACTOR BorschHackjobInheritance : CustomInventory
{
	//Inventory.ForbiddenTo "Yuri","Alosha","Marty"
}

ACTOR BorschEffectInheritance
{
	+NOCLIP
	+NOINTERACTION
	+NOGRAVITY
	Alpha 0.99
	Renderstyle Add
}

ACTOR BorschSpawnerInheritance
{
	+NOCLIP
	+NOINTERACTION
	+NOGRAVITY
}

ACTOR BorschSmokeInheritance
{
	+NOINTERACTION
	+NOGRAVITY
	+FORCERADIUSDMG
	Renderstyle Add
	States
	{
	Spawn:
	TNT1 A 0
	TNT1 A 1 A_Jump(255,"SpawnA","SpawnB","SpawnC","SpawnD","SpawnE","SpawnF","SpawnG","SpawnH","SpawnI","SpawnJ","SpawnK")
	Stop
	SpawnA:
	 VSMK A 1
	 Goto HNNNG
	SpawnB:
	 VSMK B 1
	 Goto HNNNG
	SpawnC:
	 VSMK C 1
	 Goto HNNNG
	SpawnD:
	 VSMK D 1
	 Goto HNNNG
	SpawnE:
	 VSMK E 1
	 Goto HNNNG
	SpawnF:
	 VSMK G 1
	 Goto HNNNG
	SpawnG:
	 VSMK G 1
	 Goto HNNNG
	SpawnH:
	 VSMK H 1
	 Goto HNNNG
	SpawnI:
	 VSMK I 1
	 Goto HNNNG
	SpawnJ:
	 VSMK J 1
	 Goto HNNNG
	SpawnK:
	 VSMK K 1
	 Goto HNNNG
	HNNNG:
	 VSMK A 0 A_Jump(255,"GTFO Plus","GTFO Minus")
	"GTFO Plus":
	 "####" "#" 0 //A_SetScale(ScaleX +0.01, ScaleY +0.01)
	 "####" "#" 1 A_FadeOut(0.01+random(-0.01,0.02))
	 Loop
	"GTFO Minus":
	 "####" "#" 0 //A_SetScale(ScaleX -0.01, ScaleY -0.01)
	 "####" "#" 1 A_FadeOut(0.01+random(-0.01,0.02))
	 Loop
	}
}


//////////////
//          //
//          //
// ALT-FIRE //
//          //
//          //
//////////////


//PROJECTILE

ACTOR BorschHoleProjectile
{
  Radius 11
  Height 6
  Speed 5
  Damage 0
  Projectile
  Renderstyle Add
  +FORCERADIUSDMG
  +FOILINVUL
  +RIPPER
  +CANNOTPUSH
  +BLOODLESSIMPACT
  +DONTBLAST
  +NODAMAGETHRUST
  DamageType "Superweapon"
  States
  {
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_PlaySound("Borsch/Suck",5,1.0,1,ATTN_NORM)
  Looplet:
	TNT1 A 0 A_RadiusThrust(-3000, 1280)//, RTF_NOIMPACTDAMAGE) 
	TNT1 A 0 A_Explode(2000,64,0,1)
	TNT1 A 0 Bright A_GiveInventory("BorschRingTrailer", 1) //
	VOIP A 2 Bright A_GiveInventory("BorschHoleTrailer", 1) //
	VOIP D 2 Bright A_GiveInventory("BorschHoleSmoker", 1)
	TNT1 A 0 A_RadiusThrust(-3000, 128)//, RTF_NOIMPACTDAMAGE) 
	TNT1 A 0 A_Explode(2000,64,0,1)
	VOIP B 2 Bright A_GiveInventory("BorschHoleSmoker", 1)
	TNT1 A 0 A_RadiusThrust(-3000, 128)//, RTF_NOIMPACTDAMAGE) 
	TNT1 A 0 A_Explode(2000,64,0,1)
	VOIP C 2 Bright A_GiveInventory("BorschHoleSmoker", 1)
	TNT1 A 0 A_RadiusThrust(-3000, 128)//, RTF_NOIMPACTDAMAGE) 
	TNT1 A 0 A_Explode(2000,64,0,1)
	VOIP D 2 Bright A_GiveInventory("BorschHoleSmoker", 1)
	TNT1 A 0 A_RadiusThrust(-3000, 128)//, RTF_NOIMPACTDAMAGE) 
	TNT1 A 0 A_Explode(2000,64,0,1)
	TNT1 A 0 Bright A_GiveInventory("BorschRingTrailer", 1) //
	VOIP E 2 Bright A_GiveInventory("BorschHoleTrailer", 1) //
	VOIP D 2 Bright A_GiveInventory("BorschHoleSmoker", 1)
	TNT1 A 0 A_RadiusThrust(-3000, 128)//, RTF_NOIMPACTDAMAGE) 
	TNT1 A 0 A_Explode(2000,64,0,1)
	VOIP F 2 Bright A_GiveInventory("BorschHoleSmoker", 1)
	TNT1 A 0 A_RadiusThrust(-3000, 128)//, RTF_NOIMPACTDAMAGE) 
	TNT1 A 0 A_Explode(2000,64,0,1)
	VOIP G 2 Bright A_GiveInventory("BorschHoleSmoker", 1)
	TNT1 A 0 A_RadiusThrust(-3000, 128)//, RTF_NOIMPACTDAMAGE) 
	TNT1 A 0 A_Explode(2000,64,0,1)
	VOIP H 2 Bright A_GiveInventory("BorschHoleSmoker", 1)
	TNT1 A 0 A_RadiusThrust(-3000, 128)//, RTF_NOIMPACTDAMAGE) 
	TNT1 A 0 A_Explode(2000,64,0,1)
	TNT1 A 0 Bright A_GiveInventory("BorschRingTrailer", 1) //
	VOIP I 2 Bright A_GiveInventory("BorschHoleTrailer", 1) //
	VOIP D 2 Bright A_GiveInventory("BorschHoleSmoker", 1)
	TNT1 A 0 A_RadiusThrust(-3000, 128)//, RTF_NOIMPACTDAMAGE) 
	TNT1 A 0 A_Explode(2000,64,0,1)
	VOIP J 2 Bright A_GiveInventory("BorschHoleSmoker", 1)
	TNT1 A 0 A_RadiusThrust(-3000, 128)//, RTF_NOIMPACTDAMAGE) 
	TNT1 A 0 A_Explode(2000,64,0,1)
	VOIP K 2 Bright A_GiveInventory("BorschHoleSmoker", 1)
	TNT1 A 0 A_RadiusThrust(-3000, 128)//, RTF_NOIMPACTDAMAGE) 
	TNT1 A 0 A_Explode(2000,64,0,1)
	VOIP L 2 Bright A_GiveInventory("BorschHoleSmoker", 1)
	loop
  Death:
	TNT1 A 0 A_StopSound(5)
	TNT1 A 0 A_PlaySound("Borsch/Blast",5,1.0,0)
	//HOLE ITSELF
    TNT1 A 0 A_SpawnItemEx("BorschHoleSpawn",0,0,0,0,0,0,0,0,0)
    TNT1 A 0 A_SpawnItemEx("BorschHoleSpawnDark",0,0,0,0,0,0,0,0,0)
  	Stop
  }
}

//HOLE TRAIL

Actor BorschHoleTrailer : CustomInventory 
{ 
     States 
     { 
          Spawn: 
          Pickup: 
		TNT1 A 0 
		TNT1 A 1 A_SpawnItemEx("BorschHoleTrailNormal",0,0,0,0,0,0,0,0,0)
		TNT1 A 1 A_SpawnItemEx("BorschHoleTrailDark",0,0,0,0,0,0,0,0,0)
		Stop 
     } 
}

ACTOR BorschHoleTrailNormal : BorschEffectInheritance
{
	Renderstyle Add
	States
	{
	Spawn:
	TNT1 A 0
	VOIP ABCDEFGHIJKL 2 Bright A_GiveInventory("BorschHoleEffectizer",1)
	Loop
	}
}

ACTOR BorschHoleTrailDark : BorschHoleTrailNormal
{
	Alpha 0.8
	Renderstyle Stencil
	StencilColor Black
	States
	{
	Spawn:
	TNT1 A 0
	VOIP FGHIJKLABCDE 2 Bright A_GiveInventory("BorschHoleEffectizer",1)
	Loop
	}
}

Actor BorschHoleEffectizer : CustomInventory 
{ 
     States 
     { 
          Spawn: 
          Pickup: 
		TNT1 A 0
		TNT1 A 0 //A_SetScale(ScaleX -0.01, ScaleY -0.01)
		TNT1 A 0 A_FadeOut(0.05+frandom(0.00,0.02))
		Stop 
     } 
}

//SMOKE TRAIL

Actor BorschHoleSmoker : BorschHackjobInheritance
{ 
+CLIENTSIDEONLY
     States 
     { 
          Spawn: 
          Pickup: 
		TNT1 A 0 
		TNT1 A 0 A_SpawnItemEx("BorschSmokeTrailNormal",random(28,-28),random(28,-28),random(28,-28),frandom(0.1,1.0),frandom(0.1,1.0),frandom(-1.0,1.0),random(0,359),0,0)
		TNT1 A 0 A_SpawnItemEx("BorschSmokeTrailDark",random(14,-14),random(14,-14),random(14,-14),frandom(0.1,1.0),frandom(0.1,1.0),frandom(-1.0,1.0),random(0,359),0,0)
		Stop 
     } 
}

ACTOR BorschSmokeTrailNormal : BorschSmokeInheritance
{
	Scale 0.65
	+CLIENTSIDEONLY
	Alpha 0.6
}

ACTOR BorschSmokeTrailDark : BorschSmokeTrailNormal
{
	Scale 0.5
	Alpha 0.3
	Renderstyle Stencil
	+CLIENTSIDEONLY
	StencilColor Black
	States
	{
	"GTFO Plus":
	 "####" "#" 0 //A_SetScale(ScaleX +0.01, ScaleY +0.01)
	 "####" "#" 1 A_FadeOut(0.005+random(-0.005,0.01))
	 Loop
	"GTFO Minus":
	 "####" "#" 0 //A_SetScale(ScaleX -0.01, ScaleY -0.01)
	 "####" "#" 1 A_FadeOut(0.005-random(-0.005,0.01))
	 Loop
	}
}

//RING TRAIL

ACTOR BorschRingNormalTrail : BorschEffectInheritance
{
+CLIENTSIDEONLY
	Scale 0.125
	States
	{
	Spawn:
	VSHK AA 0 A_FadeOut(0.02)
	VSHK A 0 //A_SetScale(ScaleX +0.02, ScaleY +0.02)
	VSHK A 1 Bright
	Loop
	}
}

ACTOR BorschRingDarkTrail : BorschRingNormalTrail
{
	Renderstyle Stencil
	+CLIENTSIDEONLY
	StencilColor Black
}

Actor BorschRingTrailer : BorschHackjobInheritance
{
+CLIENTSIDEONLY
     States 
     { 
          Spawn: 
          Pickup: 
		TNT1 A 0 
		TNT1 A 0 A_SpawnItemEx("BorschRingNormalTrail",0,0,0,0,0,0,0,0,0)
		TNT1 A 0 A_SpawnItemEx("BorschRingDarkTrail",0,0,0,0,0,0,0,0,0)
		Stop 
     }
}

///////////////
//           //
//           //
// PHASE ONE //
//           //
//           //
///////////////

//STRUCK

ACTOR BorschStruck : BorschEffectInheritance
{
	Alpha 0.5
	+CLIENTSIDEONLY
	Scale 2
	States
	{
	Spawn:
	PBUM A 0
	PBUM A 0 //A_SetScale(ScaleX +0.1, ScaleY +0.1)
	PBUM A 1 Bright A_FadeOut(0.01)
	Loop
	}
}

//BORSCH-HOLE

ACTOR BorschHoleSpawn : BorschEffectInheritance
{
	States
	{
	Spawn:
	TNT1 A 0
	VOIP A 0 A_SpawnItemEx("BorschHoleSound",0,0,0,0,0,0,0,0,0)
	VOIP A 0 A_Quake(7, 24, 0, 4096,"none")
	TNT1 A 0 A_SpawnItemEx("BorschStruck",0,0,0,0,0,0,0,0,0)
	VOIP AABBCCDDEEFFGGHHIIJJKKLL 1 //A_SetScale(ScaleX +0.8, ScaleY +0.8) //19.2 in total

	TNT1 A 0 A_StopSound(5)

	VOIP A 0 A_SpawnItemEx("BorschHoleDamager",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
	VOIP A 0 A_SpawnItemEx("BorschHoleSucker",0,0,1,0,0,0,0,SXF_TRANSFERPOINTERS,0)
	VOIP A 0 A_SpawnItemEx("BorschHoleNormal",0,0,0,0,0,0,0,0,0)
	VOIP A 0 A_SpawnItemEx("BorschHoleDark",0,0,0,0,0,0,0,0,0)
	VOIP A 0 A_SpawnItemEx("BorschHoleRingSpawner",0,0,0,0,0,0,0,0,0)
	VOIP A 0 A_SpawnItemEx("BorschFadeSpawner",0,0,0,0,0,0,0,0,0)
	VOIP A 0 A_SpawnItemEx("BorschBlackFadeSpawner",0,0,0,0,0,0,0,0,0)
	VOIP A 0 A_SpawnItemEx("BorschDeathSequence",0,0,0,0,0,0,0,0,0)
	VOIP A 0 A_SpawnItemEx("BorschLightningSpawner",0,0,0,0,0,0,0,0,0)
	VOIP A 0 A_SpawnItemEx("BorschSmokeSpawner",0,0,0,0,0,0,0,0,0)
	VOIP A 1
	Stop
	}
}

ACTOR BorschHoleSound : BorschSpawnerInheritance
{
+CLIENTSIDEONLY
	States
	{
	Spawn:
	TNT1 A 0
	TNT1 A 0 A_PlaySound("Borsch/SuperSuck",5,1.0,1)
	TNT1 A 384
	TNT1 A 0 A_PlaySound("Borsch/Explode",5,1.0,0)
	TNT1 A 0 A_PlaySound("Borsch/Blast",6,1.0,0)
	Stop
	}
}


ACTOR BorschHoleSpawnDark : BorschHoleSpawn
{
	Alpha 0.7
	Renderstyle Stencil
	StencilColor Black
	+CLIENTSIDEONLY
	States
	{
	Spawn:
	TNT1 A 0
	VOIP FFGGHHIIJJKKLLAABBCCDDEE 1 //A_SetScale(ScaleX +0.8, ScaleY +0.8) //19.2 in total
	Stop
	}
}

ACTOR BorschHoleNormal : BorschEffectInheritance
{
	ReactionTime 15 //360 tics, around 10 seconds
	Scale 19.3
	+CLIENTSIDEONLY
	States
	{
	Spawn:
	VOIP A 0
	Looplet:
	//VOIP A 0 A_Countdown
    VOIP ABCDEFGHIJKL 2
	VOIP ABCDEFGHIJKL 2
	VOIP ABCDEFGHIJKL 2
	VOIP ABCDEFGHIJKL 2
	VOIP ABCDEFGHIJKL 2
	VOIP ABCDEFGHIJKL 2
	VOIP ABCDEFGHIJKL 2
	VOIP ABCDEFGHIJKL 2
	VOIP ABCDEFGHIJKL 2
	VOIP ABCDEFGHIJKL 2
	VOIP ABCDEFGHIJKL 2
	VOIP ABCDEFGHIJKL 2
	VOIP ABCDEFGHIJKL 2
	VOIP ABCDEFGHIJKL 2
	VOIP ABCDEFGHIJKL 2
	//Loop
	Death:
	TNT1 A 0 A_StopSound(5)
	TNT1 A 1
	Stop
	}
}

ACTOR BorschHoleDark : BorschHoleNormal
{
	ReactionTime 10
	+CLIENTSIDEONLY
	Alpha 0.5
	Renderstyle Stencil
	StencilColor Black
	States
	{
	Spawn:
	VOIP A 0
	Looplet:
	//VOIP A 0 A_Countdown
    VOIP ABCDEFGHIJKL 3
	VOIP ABCDEFGHIJKL 3
	VOIP ABCDEFGHIJKL 3
	VOIP ABCDEFGHIJKL 3
	VOIP ABCDEFGHIJKL 3
	VOIP ABCDEFGHIJKL 3
	VOIP ABCDEFGHIJKL 3
	VOIP ABCDEFGHIJKL 3
	VOIP ABCDEFGHIJKL 3
	VOIP ABCDEFGHIJKL 3
	//Loop
	Death:
	TNT1 A 1
	Stop
	}
}

//HOLE DAMAGER

Actor BorschHoleDamager : BorschSpawnerInheritance
{ 
	ReactionTime 360
	+FORCERADIUSDMG
    +NODAMAGETHRUST
	DamageType "Superweapon"
     States 
     { 
          Spawn: 
		TNT1 A 0
		TNT1 A 0 A_SetAngle(Angle+15)
		TNT1 A 0 A_Countdown
		TNT1 A 1 A_Explode(8000,512,1,1,512)
		Loop
	  Death:
		Stop
     } 
}

//HOLE IMPLOSION

Actor BorschHoleSucker : BorschSpawnerInheritance
{ 
	ReactionTime 180
	+FORCERADIUSDMG
     States 
     { 
      Spawn: 
		TNT1 A 0
		TNT1 A 0 A_Countdown
		TNT1 A 0 A_SetAngle(Angle+10)
		TNT1 A 2 A_RadiusThrust(-25000, 1536)//, RTF_NOIMPACTDAMAGE)//, 1024) 
		Loop
	  Death:
		Stop
     } 
}

//HOLE EFFECTS

//HOLE FADE

Actor BorschFadeSpawner : BorschSpawnerInheritance
{ 
     ReactionTime 72
	 +CLIENTSIDEONLY
     States 
     { 
          Spawn: 
          Pickup: 
		TNT1 A 0 
		TNT1 A 5 A_Countdown
		TNT1 A 0 A_SpawnItemEx("BorschHoleMain",0,0,0,0,0,0,0,0,0)
		Loop
	  Death:
	 	TNT1 A 1
		Stop
     } 
}

ACTOR BorschHoleMain : BorschEffectInheritance
{
	Scale 19.5
	+CLIENTSIDEONLY
	Alpha 0.7
	States
	{
	Spawn:
	TNT1 A 0
	VOIP A 0 A_Quake(9, 360, 0, 1024,"none")
	VOIP A 0 A_Quake(6, 360, 0, 2048,"none")
	VOIP A 0 A_Quake(2, 360, 0, 4086,"none")
	VOIP A 0 A_Quake(1, 360, 0, 12258,"none")
	Looplet:
	VOIP ABCDEFGHIJKL 1 Bright A_FadeOut(0.05+frandom(0.00,0.02))
	Loop
	}
}

Actor BorschHoleEffectizer2 : BorschHackjobInheritance
{ 
+CLIENTSIDEONLY
     States 
     { 
          Spawn: 
          Pickup: 
		TNT1 A 0
		TNT1 A 0 //A_SetScale(ScaleX +0.05, ScaleY +0.05)
		TNT1 A 0 A_FadeOut(0.05+frandom(0.00,0.02))
		Stop 
     } 
}

Actor BorschBlackFadeSpawner : BorschSpawnerInheritance
{ 
     ReactionTime 60
	 +CLIENTSIDEONLY
     States 
     { 
          Spawn: 
          Pickup: 
		TNT1 A 0 
		TNT1 A 6 A_Countdown
		TNT1 A 0 A_SpawnItemEx("BorschHoleMainBlack",0,0,0,0,0,0,0,0,0)
		Loop
	  Death:
	 	TNT1 A 1
		Stop
     } 
}

ACTOR BorschHoleMainBlack : BorschEffectInheritance
{
	Scale 19.5
	Alpha 0.7
	+CLIENTSIDEONLY
	Renderstyle Stencil
	StencilColor Black
	States
	{
	Spawn:
	TNT1 A 0
	VOIP ABCDEFGHIJKL 1 Bright A_FadeOut(0.05+frandom(0.00,0.02))
	Loop
	}
}

//HOLE RING

ACTOR BorschHoleRingSpawner : BorschSpawnerInheritance
{
	ReactionTime 30
	+CLIENTSIDEONLY
	States
	{
	Spawn:
	TNT1 A 0
	TNT1 A 0 A_Countdown
	TNT1 A 6 A_SpawnItemEx("BorschRingNormal",0,0,0,0,0,0,0,0,0)
	TNT1 A 6 A_SpawnItemEx("BorschRingDark",0,0,0,0,0,0,0,0,0)
	Loop
	Death:
	Stop
	}
}

ACTOR BorschRingNormal : BorschEffectInheritance
{
	Scale 4.25
	+CLIENTSIDEONLY
	States
	{
	Spawn:
	VSHK AA 0 A_FadeOut(0.03)
	VSHK A 0 //A_SetScale(ScaleX +0.1, ScaleY +0.1)
	VSHK A 1 Bright
	Loop
	}
}

ACTOR BorschRingDark : BorschRingNormal
{
	Renderstyle Stencil
	+CLIENTSIDEONLY
	StencilColor Black
	States
	{
	Spawn:
	VSHK AA 0 A_FadeOut(0.03)
	VSHK A 0 //A_SetScale(ScaleX +0.1, ScaleY +0.1)
	VSHK A 1 Bright
	Loop
	}
}

//HOLE LIGHTNING

Actor BorschLightningSpawner : BorschSpawnerInheritance
{ 
     ReactionTime 40
	 +CLIENTSIDEONLY
     States 
     { 
          Spawn: 
          Pickup: 
		TNT1 A 0 
		TNT1 A 9 A_Countdown
		TNT1 A 0 A_SpawnItemEx("BorschHoleLightning",random(320,-320),random(320,-320),random(320,-320),0,0,0,0,0,64)
		Loop
	  Death:
	 	TNT1 A 1
		Stop
     } 
}

ACTOR BorschHoleLightning : BorschEffectInheritance
{
	Scale 1.25
	+CLIENTSIDEONLY
	States
	{
	Spawn:
	TNT1 A 0
	TNT1 A 0 A_Jump(255,"Spawn1A","Spawn1B","Spawn1C","Spawn1D","Spawn2A","Spawn2B","Spawn2C","Spawn2D")
	Spawn1A:
	1LIT A 1 Bright A_FadeOut(0.02)
	Wait
	Spawn1B:
	1LIT B 1 Bright A_FadeOut(0.02)
	Wait
	Spawn1C:
	1LIT C 1 Bright A_FadeOut(0.02)
	Wait
	Spawn1D:
	1LIT D 1 Bright A_FadeOut(0.02)
	Wait
	Spawn2A:
	2LIT A 1 Bright A_FadeOut(0.02)
	Wait
	Spawn2B:
	2LIT B 1 Bright A_FadeOut(0.02)
	Wait
	Spawn2C:
	2LIT C 1 Bright A_FadeOut(0.02)
	Wait
	Spawn2D:
	2LIT D 1 Bright A_FadeOut(0.02)
	Wait
	}
}

//HOLE SMOKE

ACTOR BorschSmokeSpawner : BorschSpawnerInheritance
{
	ReactionTime 180
	+CLIENTSIDEONLY
	States
	{
	Spawn:
	TNT1 A 0
	TNT1 A 0 A_Countdown
	TNT1 A 0 A_SpawnItemEx("BorschSmokeNormal",random(384,-384),random(384,-384),random(384,-384),frandom(0.1,1.0),frandom(0.1,1.0),frandom(-1.0,1.0),random(0,359),0,0)
	TNT1 A 2 A_SpawnItemEx("BorschSmokeDark",random(256,-256),random(256,-256),random(256,-256),frandom(0.1,1.0),frandom(0.1,1.0),frandom(-1.0,1.0),random(0,359),0,0)
	Loop
	Death:
	Stop
	}
}

ACTOR BorschSmokeNormal : BorschSmokeInheritance
{
	Scale 9.2
	+CLIENTSIDEONLY
	Alpha 0.3
	States
	{
	"GTFO Plus":
	 "####" "#" 0 //A_SetScale(ScaleX +0.01, ScaleY +0.01)
	 "####" "#" 1 A_FadeOut(0.005+random(-0.005,0.01))
	 Loop
	"GTFO Minus":
	 "####" "#" 0 //A_SetScale(ScaleX -0.01, ScaleY -0.01)
	 "####" "#" 1 A_FadeOut(0.005-random(-0.005,0.01))
	 Loop
	}
}

ACTOR BorschSmokeDark : BorschSmokeTrailNormal
{
	Scale 8.9
	+CLIENTSIDEONLY
	Alpha 0.2
	Renderstyle Stencil
	StencilColor Black
	States
	{
	"GTFO Plus":
	 "####" "#" 0 //A_SetScale(ScaleX +0.005, ScaleY +0.005)
	 "####" "#" 1 A_FadeOut(0.0025+random(-0.0025,0.005))
	 Loop
	"GTFO Minus":
	 "####" "#" 0 //A_SetScale(ScaleX -0.005, ScaleY -0.005)
	 "####" "#" 1 A_FadeOut(0.0025-random(-0.0025,0.005))
	 Loop
	}
}

///////////////
//           //
//           //
// PHASE TWO //
//           //
//           //
///////////////

Actor BorschDeathSequence : BorschEffectInheritance
{ 
     Scale 19.5
     States 
     { 
          Spawn: 
		TNT1 A 360
	  Death:
		VORX A 0 A_Quake(7, 70, 0, 12258,"none")
	 	VORX A 0 A_SpawnItemEx("BorschHoleChunkSpawner",0,0,0,0,0,0,0,0,0)
	 	VORX A 0 A_SpawnItemEx("BorschHoleExplode",0,0,0,0,0,0,0,0,0)
	 	VORX A 0 A_SpawnItemEx("BorschHoleGiantRingSpawner",0,0,0,0,0,0,0,0,0)
	 	VORX A 0 A_SpawnItemEx("BorschHoleShockwave",0,0,0,0,0,0,0,0,0)
		VORX ABCDEFGHIJKL 1
	 	VORX A 0 A_SpawnItemEx("BorschHoleAfterShockwave",0,0,0,0,0,0,0,0,0)
	 	VORX A 0 A_SpawnItemEx("BorschHoleExploFlare",0,0,0,0,0,0,0,0,0)
	 	TNT1 A 60 A_SpawnItemEx("BorschHoleAfterExplode",0,0,0,0,0,0,0,0,0)
		Stop
     } 
}

//FLARE

ACTOR BorschHoleExploFlare : BorschEffectInheritance
{
	Alpha 1
	Scale 1
	+CLIENTSIDEONLY
	States
	{
	Spawn:
	VODF A 0
	VODF A 0 //A_SetScale(ScaleX +0.1, ScaleY +0.1)
	VODF A 1 Bright A_FadeOut(0.01)
	Loop
	}
}

//CHUNK-BLAST

ACTOR BorschHoleChunkSpawner : BorschSpawnerInheritance
{
	ReactionTime 50
	+CLIENTSIDEONLY
	States
	{
	Spawn:
	TNT1 AA 0 A_Countdown
	TNT1 A 0 A_SpawnItemEx("BorschHoleChunk",random(256,-256),random(256,-256),random(128,0),frandom(3.0,10.0),0,frandom(15.0,20.0),frandom(0.0,359.0),SXF_CLIENTSIDE,0)
	Loop
	}
}

ACTOR BorschHoleChunk : BorschHoleProjectile
{
  Gravity 0.15
  +CLIENTSIDEONLY
  -NOGRAVITY
  States
  {
  Death:
	TNT1 A 0 A_PlaySound("Weapons/MinibeliskDead",5)
	TNT1 A 0 A_Explode(4000,64)
        TNT1 A 0 A_Quake (4, 27, 0, 256, none)
        TNT1 A 0 A_Quake (1, 27, 0, 384, none)
	TNT1 A 0 A_SpawnItemEx("BorschChunkWaver")
	TNT1 AAAAAAAAAAAAAAA 0 A_SpawnItemEx("BorschSmokeTrailNormal",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
	TNT1 AAAAAAAAAAAAAAA 0 A_SpawnItemEx("BorschSmokeTrailDark",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
	TNT1 A 0 A_SpawnItemEx("BorschChunkWaver")
	VORX ABCD 1
	TNT1 AAAAAAAAAAAA 0 A_SpawnItemEx("BorschSmokeTrailNormal",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
	TNT1 AAAAAAAAAAAA 0 A_SpawnItemEx("BorschSmokeTrailDark",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
	TNT1 A 0 A_SpawnItemEx("BorschChunkWaver")
	VORX EFGH 1
	TNT1 AAAAAAAAA 0 A_SpawnItemEx("BorschSmokeTrailNormal",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
	TNT1 AAAAAAAAA 0 A_SpawnItemEx("BorschSmokeTrailDark",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
	TNT1 A 0 A_SpawnItemEx("BorschChunkWaver")
	VORX IJKL 1
	TNT1 AAAAAA 0 A_SpawnItemEx("BorschSmokeTrailNormal",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
	TNT1 AAAAAA 0 A_SpawnItemEx("BorschSmokeTrailDark",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
	TNT1 A 0 A_SpawnItemEx("BorschChunkWaver")
        TNT1 B 30
  	Stop
  }
}

ACTOR BorschChunkWaveNormal : BorschEffectInheritance
{
	Scale 0.175
	+CLIENTSIDEONLY
	States
	{
	Spawn:
	VSHK AA 0 A_FadeOut(0.02)
	VSHK A 0 //A_SetScale(ScaleX +0.03, ScaleY +0.03)
	VSHK A 1 Bright
	Loop
	}
}

ACTOR BorschChunkWaveDark : BorschChunkWaveNormal
{
	Renderstyle Stencil
	+CLIENTSIDEONLY
	StencilColor Black
}

Actor BorschChunkWaver : BorschHackjobInheritance
{
+CLIENTSIDEONLY
     States 
     { 
          Spawn: 
          Pickup: 
		TNT1 A 0 
		TNT1 A 0 A_SpawnItemEx("BorschChunkWaveNormal",0,0,0,0,0,0,0,0,0)
		TNT1 A 0 A_SpawnItemEx("BorschChunkWaveDark",0,0,0,0,0,0,0,0,0)
		Stop 
     }
}

ACTOR BorschHoleRingSpawnerShort : BorschHoleRingSpawner
{
	ReactionTime 3
	+CLIENTSIDEONLY
}

//BORSCH HOLE EXPLOSION

ACTOR BorschHoleExplode : BorschSpawnerInheritance
{
	ReactionTime 100
	States
	{
	Spawn:
	TNT1 AA 0 A_Countdown
	TNT1 A 0 A_SpawnItemEx("BorschHoleFlame",random(32,-32),random(32,-32),random(32,32),frandom(10.0,2.0),frandom(10.0,2.0),frandom(10.0,-10.0),frandom(0.0,359.0),SXF_CLIENTSIDE,0)
	Loop
	}
}

ACTOR BorschHoleFlame : BorschEffectInheritance
{
	Scale 0.5
	Alpha 0.5
	+FORCERADIUSDMG
	DamageType "Superweapon"
	States
	{
	Spawn:
	TNT1 A 0
	TNT1 A 1 A_Jump(255,"SpawnA","SpawnB","SpawnC","SpawnD")
	Stop
	SpawnA:
	 VODB A 0 A_JumpIf(Alpha<0.18,2)
	 VODB A 0 A_Explode(600,256)
	 VODB A 0 //A_SetScale(ScaleX +0.01, ScaleY +0.01)
	 VODB A 1 A_FadeOut(0.005+random(-0.005,0.0005))
	 Loop
	SpawnB:
	 VODB A 0 A_JumpIf(Alpha<0.18,2)
	 VODB A 0 A_Explode(600,256)
	 VODB B 0 //A_SetScale(ScaleX +0.01, ScaleY +0.01)
	 VODB B 1 A_FadeOut(0.005+random(-0.005,0.0005))
	 Loop
	SpawnC:
	 VODB A 0 A_JumpIf(Alpha<0.18,2)
	 VODB A 0 A_Explode(600,256)
	 VODB C 0 //A_SetScale(ScaleX +0.01, ScaleY +0.01)
	 VODB C 1 A_FadeOut(0.005+random(-0.005,0.0005))
	 Loop
	SpawnD:
	 VODB A 0 A_JumpIf(Alpha<0.18,2)
	 VODB A 0 A_Explode(600,256)
	 VODB D 0 //A_SetScale(ScaleX +0.01, ScaleY +0.01)
	 VODB D 1 A_FadeOut(0.005+random(-0.005,0.0005))
	 Loop
	}
}

ACTOR BorschHoleAfterExplode : BorschSpawnerInheritance
{
	ReactionTime 100
	+CLIENTSIDEONLY
	States
	{
	Spawn:
	TNT1 AA 0 A_Countdown
	TNT1 A 0 A_SpawnItemEx("BorschHoleAfterFlame",random(32,-32),random(32,-32),random(32,32),frandom(10.0,2.0),frandom(10.0,2.0),frandom(10.0,-10.0),frandom(0.0,359.0),SXF_CLIENTSIDE,0)
	Loop
	}
}

ACTOR BorschHoleAfterFlame : BorschEffectInheritance
{
	ReactionTime 70
	+CLIENTSIDEONLY
	Renderstyle Stencil
	StencilColor Black
	Alpha 0.5
	States
	{
	Spawn:
	TNT1 A 0
	TNT1 A 1 A_Jump(255,"SpawnA","SpawnB","SpawnC")
	Stop
	SpawnA:
	 TNT1 A 0 A_Countdown
	 VODS A 0 //A_SetScale(ScaleX +0.01, ScaleY +0.01)
	 VODS A 1 A_FadeOut(0.0005+random(-0.0005,0.0005))
	 Loop
	SpawnB:
	 TNT1 A 0 A_Countdown
	 VODS B 0 //A_SetScale(ScaleX +0.01, ScaleY +0.01)
	 VODS B 1 A_FadeOut(0.0005+random(-0.0005,0.0005))
	 Loop
	SpawnC:
	 TNT1 A 0 A_Countdown
	 VODS C 0 //A_SetScale(ScaleX +0.01, ScaleY +0.01)
	 VODS C 1 A_FadeOut(0.0005+random(-0.0005,0.0005))
	 Loop
	Death:
	 TNT1 A 0 A_SpawnItemEx("BorschHoleAfterFlame2",0,0,0,frandom(0.1,0.05),frandom(0.1,0.05),frandom(0.1,0.05),random(0,359))
	 Stop
	}
}

ACTOR BorschHoleAfterFlame2 : BorschHoleAfterFlame
{
	Renderstyle Stencil
	+CLIENTSIDEONLY
	StencilColor Black
	Alpha 0.5
	States
	{
	Spawn:
	TNT1 A 0
	TNT1 A 1 A_Jump(255,"SpawnA","SpawnB","SpawnC")
	Stop
	SpawnA:
	 VODS A 0 //A_SetScale(ScaleX +0.01, ScaleY +0.01)
	 VODS A 1 A_FadeOut(0.0025+random(-0.0025,0.0025))
	 Loop
	SpawnB:
	 VODS B 0 //A_SetScale(ScaleX +0.01, ScaleY +0.01)
	 VODS B 1 A_FadeOut(0.0025+random(-0.0025,0.0025))
	 Loop
	SpawnC:
	 VODS C 0 //A_SetScale(ScaleX +0.01, ScaleY +0.01)
	 VODS C 1 A_FadeOut(0.0025+random(-0.0025,0.0025))
	 Loop
	}
}

//HOLE BLAST SHOCKWAVE

ACTOR BorschHoleShockwave : BorschSpawnerInheritance
{
	ReactionTime 200
	States
	{
	Spawn:
	TNT1 AA 0 A_Countdown
	TNT1 A 0 A_SpawnItemEx("BorschHoleFlame",random(32,-32),random(32,-32),random(32,32),frandom(9.0,8.0),frandom(9.0,8.0),frandom(0.1,-0.1),frandom(0.0,359.0),SXF_CLIENTSIDE,0)
	Loop
	}
}

ACTOR BorschHoleAfterShockwave : BorschSpawnerInheritance
{
	ReactionTime 200
	+CLIENTSIDEONLY
	States
	{
	Spawn:
	TNT1 AA 0 A_Countdown
	TNT1 A 0 A_SpawnItemEx("BorschHoleAfterFlame2",random(32,-32),random(32,-32),random(32,32),frandom(7.0,6.0),frandom(7.0,6.0),frandom(0.1,-0.1),frandom(0.0,359.0),SXF_CLIENTSIDE,0)
	Loop
	}
}

//HOLE BLAST RING

ACTOR BorschHoleGiantRingSpawner : BorschSpawnerInheritance
{
	ReactionTime 6
	+CLIENTSIDEONLY
	States
	{
	Spawn:
	TNT1 A 0
	TNT1 A 0 A_Countdown
	TNT1 A 6 A_SpawnItemEx("BorschGiantRingNormal",0,0,0,0,0,0,0,0,0)
	TNT1 A 6 A_SpawnItemEx("BorschGiantRingDark",0,0,0,0,0,0,0,0,0)
	Loop
	Death:
	Stop
	}
}

ACTOR BorschGiantRingNormal : BorschEffectInheritance
{
	Scale 5.25
	+CLIENTSIDEONLY
	States
	{
	Spawn:
	VSHK AA 0 A_FadeOut(0.02)
	VSHK A 0 //A_SetScale(ScaleX +0.2, ScaleY +0.2)
	VSHK A 1 Bright
	Loop
	}
}

ACTOR BorschGiantRingDark : BorschRingNormal
{
	Renderstyle Stencil
	StencilColor Black
	+CLIENTSIDEONLY
	States
	{
	Spawn:
	VSHK AA 0 A_FadeOut(0.02)
	VSHK A 0 //A_SetScale(ScaleX +0.2, ScaleY +0.2)
	VSHK A 1 Bright
	Loop
	}
}

//////////////
//          //
//          //
//   FIRE   //
//          //
//          //
//////////////

ACTOR DarkWeave
{
  Radius 16
  Height 28
  Speed 20
  Projectile
  BounceType Grenade
  ReactionTime 70
  BounceFactor 1.0
  WallBounceFactor 1.0
  BounceCount 16
  Obituary "%o succumbed to the %k's homing void thingy."
  +DONTBLAST
  +RIPPER
  +MISSILE
  +CANNOTPUSH
  //+STEPMISSILE
  //+DROPOFF
  +FLOORHUGGER //Well, homing with the new method makes it fly, so I had to use FLOORHUGGER again.
  +NOEXPLODEFLOOR
  +THRUACTORS
  +FORCERADIUSDMG
  +BLOODLESSIMPACT
  +NODAMAGETHRUST
  +THRUGHOST
  +EXPLODEONWATER
  +SEEKERMISSILE
  +DONTBLAST
  Renderstyle Shaded
  Alpha 0.8
  Scale 0.4
  //MaxStepHeight 48
  //Gravity 0.5
  States
  {
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_Countdown
	TNT1 A 0 A_PlaySound("Torchglow/Wall",5,0.6,1)
	TNT1 A 0 A_PlaySound("Borsch/Suck",6,0.8,1)
	TNT1 A 0 A_RadiusThrust(-3000, 256)//, RTF_NOIMPACTDAMAGE) 
	TNT1 A 0 A_Quake(2,1,0,256)
	TNT1 A 0 A_Explode(500,64,0,1)
	TNT1 A 0 A_SpawnItemEx("BorschSmokeTrailNormal",random(18,-18),random(18,-18),random(18,4),frandom(0.025,0.05),frandom(0.025,0.05),frandom(0.025,0.05),random(0,359),0,0)
	TNT1 A 0 A_SpawnItemEx("BorschSmokeTrailDark",random(12,-12),random(12,-12),random(12,2),frandom(0.025,0.05),frandom(0.025,0.05),frandom(0.2,2.0),random(0,359),0,0)
	TNT1 A 0 A_SpawnItemEx("BorschSmokeTrailNormal",random(28,-28),random(28,-28),random(18,4),frandom(0.025,0.05),frandom(0.025,0.05),frandom(1.25,2.0),random(0,359),0,0)
	TNT1 A 0 A_SpawnItemEx("BorschSmokeTrailDark",random(22,-22),random(22,-22),random(12,2),frandom(0.025,0.05),frandom(0.025,0.05),frandom(1.25,2.0),random(0,359),0,0)
	TNT1 A 0 A_SpawnItemEx("BorschRingNormalTrail")
	TNT1 A 0 A_SpawnItemEx("BorschRingDarkTrail",0,0,0,0,0,frandom(0.1,0.15))
	TNT1 A 0 A_SpawnItemEx("BorschParticleNormal",random(22,-22),random(22,-22),random(22,2),frandom(0.25,0.5),frandom(0.25,0.5),frandom(0.25,0.5),random(0,359),0,0)
	TNT1 A 0 A_SpawnItemEx("BorschParticleDark",random(22,-22),random(22,-22),random(22,2),frandom(0.25,0.5),frandom(0.25,0.5),frandom(0.25,0.5),random(0,359),0,0)
	TNT1 A 0 A_SpawnItemEx("BorschParticleNormal",random(12,-12),random(12,-12),random(12,-12),frandom(0.1,0.05),frandom(0.1,0.05),frandom(0.25,2.0),random(0,359),0,0)
	TNT1 A 0 A_SpawnItemEx("BorschParticleDark",random(12,-12),random(12,-12),random(12,-12),frandom(0.1,0.05),frandom(0.1,0.05),frandom(0.25,2.0),random(0,359),0,0)
	RAMD BB 1 A_SeekerMissile(25,50,SMF_LOOK|SMF_PRECISE,256,7)
	TNT1 A 0 A_SpawnItemEx("BorschSmokeTrailNormal",random(18,-18),random(18,-18),random(18,4),frandom(0.025,0.05),frandom(0.025,0.05),frandom(0.025,0.05),random(0,359),0,0)
	TNT1 A 0 A_SpawnItemEx("BorschSmokeTrailDark",random(12,-12),random(12,-12),random(12,2),frandom(0.025,0.05),frandom(0.025,0.05),frandom(0.2,2.0),random(0,359),0,0)
	TNT1 A 0 A_SpawnItemEx("BorschSmokeTrailNormal",random(28,-28),random(28,-28),random(18,4),frandom(0.025,0.05),frandom(0.025,0.05),frandom(1.25,2.0),random(0,359),0,0)
	TNT1 A 0 A_SpawnItemEx("BorschSmokeTrailDark",random(22,-22),random(22,-22),random(12,2),frandom(0.025,0.05),frandom(0.025,0.05),frandom(1.25,2.0),random(0,359),0,0)

	TNT1 A 0 A_SpawnItemEx("BorschParticleNormal",random(22,-22),random(22,-22),random(22,2),frandom(0.25,0.5),frandom(0.25,0.5),frandom(0.25,0.5),random(0,359),0,0)
	TNT1 A 0 A_SpawnItemEx("BorschParticleDark",random(22,-22),random(22,-22),random(22,2),frandom(0.25,0.5),frandom(0.25,0.5),frandom(0.25,0.5),random(0,359),0,0)
	TNT1 A 0 A_SpawnItemEx("BorschParticleNormal",random(12,-12),random(12,-12),random(12,-12),frandom(0.1,0.05),frandom(0.1,0.05),frandom(0.25,2.0),random(0,359),0,0)
	TNT1 A 0 A_SpawnItemEx("BorschParticleDark",random(12,-12),random(12,-12),random(12,-12),frandom(0.1,0.05),frandom(0.1,0.05),frandom(0.25,2.0),random(0,359),0,0)
	RAMD BB 1 A_SeekerMissile(25,50,SMF_LOOK|SMF_PRECISE,256,7)
	Loop
  Death:
	TNT1 A 0 A_PlaySound("Weapons/MinibeliskDead",5)
	TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_Explode(4000,64)
    TNT1 A 0 A_Quake (4, 27, 0, 256, none)
    TNT1 A 0 A_Quake (1, 27, 0, 384, none)
	TNT1 A 0 A_SpawnItemEx("BorschChunkWaver")
    TNT1 A 0 A_SpawnItemEx("RamjetImpactFlareSpawner")
	TNT1 AAAAAAAAAAAAAAA 0 A_SpawnItemEx("BorschSmokeTrailNormal",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
	TNT1 AAAAAAAAAAAAAAA 0 A_SpawnItemEx("BorschSmokeTrailDark",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
	TNT1 A 0 A_SpawnItemEx("BorschChunkWaver")
	VORX ABCD 1
	TNT1 AAAAAAAAAAAA 0 A_SpawnItemEx("BorschSmokeTrailNormal",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
	TNT1 AAAAAAAAAAAA 0 A_SpawnItemEx("BorschSmokeTrailDark",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
	TNT1 A 0 A_SpawnItemEx("BorschChunkWaver")
	VORX EFGH 1
	TNT1 AAAAAAAAA 0 A_SpawnItemEx("BorschSmokeTrailNormal",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
	TNT1 AAAAAAAAA 0 A_SpawnItemEx("BorschSmokeTrailDark",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
	TNT1 A 0 A_SpawnItemEx("BorschChunkWaver")
	VORX IJKL 1
	TNT1 AAAAAA 0 A_SpawnItemEx("BorschSmokeTrailNormal",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
	TNT1 AAAAAA 0 A_SpawnItemEx("BorschSmokeTrailDark",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
	TNT1 A 0 A_SpawnItemEx("BorschChunkWaver")
    TNT1 B 30
  	Stop
	}
}

Actor BorschParticleNormal
{
  +NOINTERACTION
  +CLIENTSIDEONLY
  Renderstyle Add
  Scale 0.1
  States
  {
  Spawn:
  TNT1 A 0
  TNT1 A 0 //A_SetScale(ScaleX-0.0025,ScaleY-0.0025)
  VODM A 1 Bright A_FadeOut(0.025)
  Loop
  }
}	

Actor BorschParticleDark
{
  +NOINTERACTION
   +CLIENTSIDEONLY
  Renderstyle Shaded
  Scale 0.1
  States
  {
  Spawn:
  TNT1 A 0
  TNT1 A 0 //A_SetScale(ScaleX-0.0025,ScaleY-0.0025)
  VODM B 1 A_FadeOut(0.025)
  Loop
  }
}

//MULTI HOLE

ACTOR BorschMultiHoleSpawner : DarkWeave
{
  Projectile
  BounceType None
  ReactionTime 20
  BounceCount 1
  Obituary "%o succumbed to %k's multiple black hole!"
  -FLOORHUGGER
  -SEEKERMISSILE
  States
  {
  Death:
	TNT1 A 0 A_StopSound(5)
	TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_PlaySound("Borsch/Blast",5,1.0,0)
    TNT1 A 0 A_SpawnItemEx("BorschHoleSpawn2",0,0,0,0,0,0,0,0,0)
    TNT1 A 0 A_SpawnItemEx("BorschHoleSpawnDark",0,0,0,0,0,0,0,0,0)
  	Stop
	}
}

ACTOR BorschHoleClusterProjectile : BorschHoleProjectile
{
  Speed 10
  States
  {
  Death:
	TNT1 A 0 A_StopSound(5)
	TNT1 A 0 A_PlaySound("Borsch/Blast",5,1.0,0)
	//HOLE ITSELF
    TNT1 A 0 A_SpawnItemEx("BorschHoleSpawn",0,0,0,0,0,0,0,0,0)
    TNT1 A 0 A_SpawnItemEx("BorschHoleSpawnDark",0,0,0,0,0,0,0,0,0)

    TNT1 A 0 A_SpawnItemEx("BorschMultiHoleSpawner",0,0,0,20,0,0,0,0,0)
    TNT1 A 0 A_SpawnItemEx("BorschMultiHoleSpawner",0,0,0,20,0,0,45,0,0)
    TNT1 A 0 A_SpawnItemEx("BorschMultiHoleSpawner",0,0,0,20,0,0,90,0,0)
    TNT1 A 0 A_SpawnItemEx("BorschMultiHoleSpawner",0,0,0,20,0,0,135,0,0)
    TNT1 A 0 A_SpawnItemEx("BorschMultiHoleSpawner",0,0,0,20,0,0,180,0,0)
    TNT1 A 0 A_SpawnItemEx("BorschMultiHoleSpawner",0,0,0,20,0,0,225,0,0)
    TNT1 A 0 A_SpawnItemEx("BorschMultiHoleSpawner",0,0,0,20,0,0,270,0,0)
    TNT1 A 1 A_SpawnItemEx("BorschMultiHoleSpawner",0,0,0,20,0,0,315,0,0)
  	Stop
  }
}

ACTOR BorschHoleSpawn2 : BorschEffectInheritance //Without chunks on death, because they lag like hell
{
	States
	{
	Spawn:
	TNT1 A 0
	VOIP A 0 A_SpawnItemEx("BorschHoleSound",0,0,0,0,0,0,0,0,0)
	VOIP A 0 A_Quake(7, 24, 0, 4096,"none")
	TNT1 A 0 A_SpawnItemEx("BorschStruck",0,0,0,0,0,0,0,0,0)
	VOIP AABBCCDDEEFFGGHHIIJJKKLL 1 //A_SetScale(ScaleX +0.8, ScaleY +0.8) //19.2 in total

	TNT1 A 0 A_StopSound(5)

	VOIP A 0 A_SpawnItemEx("BorschHoleDamager",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
	VOIP A 0 A_SpawnItemEx("BorschHoleSucker",0,0,1,0,0,0,0,SXF_TRANSFERPOINTERS,0)
	VOIP A 0 A_SpawnItemEx("BorschHoleNormal",0,0,0,0,0,0,0,0,0)
	VOIP A 0 A_SpawnItemEx("BorschHoleDark",0,0,0,0,0,0,0,0,0)
	VOIP A 0 A_SpawnItemEx("BorschHoleRingSpawner",0,0,0,0,0,0,0,0,0)
	VOIP A 0 A_SpawnItemEx("BorschFadeSpawner",0,0,0,0,0,0,0,0,0)
	VOIP A 0 A_SpawnItemEx("BorschBlackFadeSpawner",0,0,0,0,0,0,0,0,0)
	VOIP A 0 A_SpawnItemEx("BorschDeathSequence2",0,0,0,0,0,0,0,0,0)
	VOIP A 0 A_SpawnItemEx("BorschLightningSpawner",0,0,0,0,0,0,0,0,0)
	VOIP A 0 A_SpawnItemEx("BorschSmokeSpawner",0,0,0,0,0,0,0,0,0)
	VOIP A 1
	Stop
	}
}

ACTOR BorschHoleSpawnDark2 : BorschHoleSpawn2
{
	Alpha 0.7
	Renderstyle Stencil
	StencilColor Black
	+CLIENTSIDEONLY
	States
	{
	Spawn:
	TNT1 A 0
	VOIP FFGGHHIIJJKKLLAABBCCDDEE 1 //A_SetScale(ScaleX +0.8, ScaleY +0.8) //19.2 in total
	Stop
	}
}

Actor BorschDeathSequence2 : BorschEffectInheritance
{ 
     Scale 19.5
     States 
     { 
          Spawn: 
		TNT1 A 360
	  Death:
		VORX A 0 A_Quake(7, 70, 0, 12258,"none")
	 	VORX A 0 A_SpawnItemEx("BorschHoleExplode",0,0,0,0,0,0,0,0,0)
	 	VORX A 0 A_SpawnItemEx("BorschHoleGiantRingSpawner",0,0,0,0,0,0,0,0,0)
	 	VORX A 0 A_SpawnItemEx("BorschHoleShockwave",0,0,0,0,0,0,0,0,0)
		VORX ABCDEFGHIJKL 1
	 	VORX A 0 A_SpawnItemEx("BorschHoleAfterShockwave",0,0,0,0,0,0,0,0,0)
	 	VORX A 0 A_SpawnItemEx("BorschHoleExploFlare",0,0,0,0,0,0,0,0,0)
	 	TNT1 A 60 A_SpawnItemEx("BorschHoleAfterExplode",0,0,0,0,0,0,0,0,0)
		Stop
     } 
}