
ACTOR FreedoomSkag1337 : weapon
{
Weapon.UpSound "doomguy/doomswitch"
Height 20
  Weapon.SelectionOrder 2800
  Weapon.AmmoUse 20
  Weapon.AmmoGive 120
  Weapon.AmmoType "Cell"
  +WEAPON.NOAUTOFIRE
  Obituary "%o got sucked into the singularity."
  Inventory.PickupMessage "FACE THE WRATH OF THE SUPER KICK ASS GUN!"
  Tag "SKAG-1337"
  Inventory.RestrictedTo "FreedoomGuyClass"
States
  {
  Ready:
		SKAG A 1 A_WeaponReady
		Loop
   Deselect:
		SKAG A 1 A_Lower
		TNT1 A 0 A_Lower 
		TNT1 A 0 A_Lower 
		Loop
	Select:
		SKAG A 1 A_Raise
		TNT1 A 0 A_Raise 
		TNT1 A 0 A_Raise 
		Loop
	Fire:
		TNT1 A 0 A_playsound("SKAG/CHARGE",CHAN_WEAPON)
		TNT1 A 0 A_playsound("SKAG/CHARGE",7)
		SKAG A 2 Bright
		SKAG BCDEFGHI 3 Bright
		SKAG FGHI 3 Bright
		SKAG FGHI 3 Bright
		SKAG FGHI 3 Bright Radius_Quake (3, 60, 0, 11, 0)
		SKAG FGHI 3 Bright Radius_Quake (3, 60, 0, 11, 0)
		TNT1 A 0 A_Quake(5, 7, 0, 128, "NOSOUND")
		TNT1 A 0 A_giveinventory("DrDoomguySlowdown",1)
		TNT1 A 0 A_playsound("SKAG/FIRE",CHAN_WEAPON)
		TNT1 A 0 A_playsound("SKAG/FIRE",7)
		TNT1 A 0 A_GunFlash
		TNT1 A 0 A_firecustommissile("DMBALL")
		TNT1 A 0 A_playsound("drdoomguy/DRBFGSExplode",7)
		SKAG JK 2 
		SKAG L 14
		SKAG L 10 A_ReFire
		Goto Ready
	}
}

Actor DMBall
{
Radius 13
Height 8
Speed 17
Damage 450
Projectile
+FORCEXYBILLBOARD
+NODAMAGETHRUST
+RIPPER
+NOBOSSRIP
//+FORCERADIUSDMG
-THRUGHOST
Renderstyle Translucent
Damagetype BlackHole
Scale 0.10
SeeSound "DSKTESLA"
DeathSound "DMBall/Impact"
//Decal "Scorch"
States
{
Spawn:
	TNT1 A 0 Thing_ChangeTid(0,1796)
	ORBP AA 1 Bright //A_RadiusThrust(-220,130)
	TNT1 A 0 A_Explode(20,90,0)
	TNT1 A 0 A_SpawnItem("DMBTrail",0,8,0)
    BHOL A 0 A_SpawnItemEx("PurpleTrailSparks", 0, 0, 8, 0, 0, 0, 0, 128)
	ORBP BB 1 Bright //A_RadiusThrust(-220,150)
	TNT1 A 0 A_Explode(20,90,0)
	TNT1 A 0 A_SpawnItem("DMBTrail",0,8,0)
    BHOL A 0 A_SpawnItemEx("PurpleTrailSparks", 0, 0, 8, 0, 0, 0, 0, 128)
	ORBP CC 1 Bright //A_RadiusThrust(-220,150)
	TNT1 A 0 A_Explode(20,90,0)
	TNT1 A 0 A_SpawnItem("DMBTrail",0,8,0)
    BHOL A 0 A_SpawnItemEx("PurpleTrailSparks", 0, 0, 8, 0, 0, 0, 0, 128)
	ORBP DD 1 Bright //A_RadiusThrust(-220,150)
	TNT1 A 0 A_Explode(20,90,0)
	TNT1 A 0 A_SpawnItem("DMBTrail",0,8,0)
    BHOL A 0 A_SpawnItemEx("PurpleTrailSparks", 0, 0, 8, 0, 0, 0, 0, 128)
	ORBP EE 1 Bright //A_RadiusThrust(-220,150)
	loop
	
Death:
	TNT1 A 0 Thing_ChangeTid(0,1796)
	TNT1 A 0 A_SpawnItem("BlackHole",0,0,0)
	TNT1 A 0 A_SetScale(1.2)
	VORX ABCDEFGH 2 Bright A_Explode(256, 360, 1)
	Stop
}
}

Actor DMBTrail
{
+NOGRAVITY
+FORCEXYBILLBOARD
RenderStyle Translucent
Alpha 0.70
Scale 0.7
States
{
Spawn:
	VORX ABCDEFGH 2 Bright A_FadeOut(0.1)
	Stop
}
}

Actor BHSmoke : DMBTrail
{
Scale 2.2
Damagetype BlackHole
+NOCLIP
+NOGRAVITY
+FORCEXYBILLBOARD
States
{
Spawn:
	BHXP ABCDEFGHIJKLMNO 2 A_FadeOut(0.03)
	Stop
}
}

Actor BHMiniSmoke : DMBTrail
{
Scale 0.65
Alpha 0.45
Damagetype BlackHole
+NOCLIP
+NOGRAVITY
+FORCEXYBILLBOARD
States
{
Spawn:
	BHXP ABCDEFGHIJKLMNO 2 A_FadeOut(0.03)
	Stop
}
}

Actor BHExplosion
{
Damagetype BlackHole
+NOCLIP
+NOGRAVITY
+FORCEXYBILLBOARD
States
{
Spawn:
	DBX3 A 1 Light("BHEXP_1") Bright A_SetScale(1.2)
	TNT1 A 0 A_FadeOut(0.13)
	DBX3 A 1 Light("BHEXP_2") Bright A_SetScale(1.4)
	TNT1 A 0 A_FadeOut(0.13)
	DBX3 A 1 Light("BHEXP_3") Bright A_SetScale(1.6)
	TNT1 A 0 A_FadeOut(0.13)
	DBX3 A 1 Light("BHEXP_4") Bright A_SetScale(1.8)
	TNT1 A 0 A_FadeOut(0.13)
	DBX3 A 1 Light("BHEXP_5") Bright A_SetScale(2.0)
	TNT1 A 0 A_FadeOut(0.13)
	DBX3 A 1 Light("BHEXP_6") Bright A_SetScale(2.2)
	TNT1 A 0 A_FadeOut(0.13)
	DBX3 A 1 Light("BHEXP_7") Bright A_SetScale(2.4)
	TNT1 A 0 A_FadeOut(0.13)
	DBX3 A 1 Bright A_SetScale(2.6)
	TNT1 A 0 A_FadeOut(0.13)
	DBX3 A 1 Bright A_SetScale(2.8)
	TNT1 A 0 A_FadeOut(0.13)
	DBX3 A 1 Bright A_SetScale(3.0)
	TNT1 A 0 A_FadeOut(0.13)
	Stop
}
}

ACTOR PurpleShockWave 
{ 
   Speed 0
   Height 64 
   Radius 32
   Scale 2.25 
   RenderStyle add
   Alpha 0.9
   +DROPOFF 
   +NOBLOCKMAP 
   +NOGRAVITY 
   States 
   { 
   Spawn: 
      SH0K A 1 BRIGHT
      Goto Death 
   Death: 
      SH0K BCDEFFGGHHIIIJJJKKKLLMMNNOPQR 1 BRIGHT A_FadeOut(0.03)
      Stop 
	}
}


Actor TPortal : SwitchableDecoration // Add a DoomEdNumber as necessary
{

	+NOINTERACTION
	+NOBLOCKMAP
	+NOGRAVITY
	+NOTELEPORT
	+FORCEXYBILLBOARD
	RenderStyle Add
	Alpha 0.8
	Scale 0.25
	States
	{
	Spawn:
	Active:
		TNT1 AAAAA 7 A_SpawnItemEx("TPortLightningWaveSpawner",0,0,32,0,0,0,0,0,172)
		TNT1 A 0 A_SetTranslucent(0.1,1)
		TNT1 A 0 A_PlaySound("TPortalAppear")
		ORBP ABCDCB 1 bright Light("TPortNormal") A_RadiusThrust(-700,1000, RTF_NOIMPACTDAMAGE)
		ORBP A 0 A_SpawnItemEx("TPortLightningWaveSpawner",0,0,32,0,0,0,0,0,160)
		TNT1 A 0 A_SetTranslucent(0.2,1)
		ORBP ABCDCB 1 bright Light("TPortNormal") A_RadiusThrust(-700,1000, RTF_NOIMPACTDAMAGE)
		ORBP A 0 A_SpawnItemEx("TPortLightningWaveSpawner",0,0,32,0,0,0,0,0,160)
		TNT1 A 0 A_SetTranslucent(0.3,1)
		ORBP ABCDCB 1 bright Light("TPortNormal") A_RadiusThrust(-700,1000, RTF_NOIMPACTDAMAGE)
		ORBP A 0 A_SpawnItemEx("TPortLightningWaveSpawner",0,0,32,0,0,0,0,0,160)
		TNT1 A 0 A_SetTranslucent(0.4,1)
		ORBP ABCDCB 1 bright Light("TPortNormal") A_RadiusThrust(-700,1000, RTF_NOIMPACTDAMAGE)
		ORBP A 0 A_SpawnItemEx("TPortLightningWaveSpawner",0,0,32,0,0,0,0,0,160)
		TNT1 A 0 A_SetTranslucent(0.5,1)
		ORBP ABCDCB 1 bright Light("TPortNormal") A_RadiusThrust(-700,1000, RTF_NOIMPACTDAMAGE)
		ORBP A 0 A_SpawnItemEx("TPortLightningWaveSpawner",0,0,32,0,0,0,0,0,160)
		TNT1 A 0 A_SetTranslucent(0.6,1)
		ORBP ABCDCB 1 bright Light("TPortNormal") A_RadiusThrust(-700,1000, RTF_NOIMPACTDAMAGE)
		ORBP A 0 A_SpawnItemEx("TPortLightningWaveSpawner",0,0,32,0,0,0,0,0,160)
		TNT1 A 0 A_SetTranslucent(0.7,1)
		ORBP ABCDCB 1 bright Light("TPortNormal") A_RadiusThrust(-700,1000, RTF_NOIMPACTDAMAGE)
		ORBP A 0 A_SpawnItemEx("TPortLightningWaveSpawner",0,0,32,0,0,0,0,0,160)
		TNT1 A 0 A_SetTranslucent(0.8,1)
		goto Activated
	Activated:
		TNT1 A 0
		TNT1 A 0 A_PlaySound("TPortalLoop",5,1,1)
		goto Ready
	Ready:
		ORBP ABCDCB 1 bright Light("TPortNormal") A_RadiusThrust(-700,1000, RTF_NOIMPACTDAMAGE)
		ORBP A 0 A_SpawnItemEx("TPortLightningWaveSpawner",0,0,32,0,0,0,0,0,160)
		loop
	Inactive:
		TNT1 A 0 A_StopSound(5)
		TNT1 A 0 A_PlaySound("TPortalFade")
		ORBP ABCDCB 1 bright Light("TPortNormal") A_RadiusThrust(-700,1000, RTF_NOIMPACTDAMAGE)
		ORBP A 0 A_SpawnItemEx("TPortLightningWaveSpawner",0,0,32,0,0,0,0,0,160)
		TNT1 A 0 A_SetTranslucent(0.8,1)
		ORBP ABCDCB 1 bright Light("TPortNormal") A_RadiusThrust(-700,1000, RTF_NOIMPACTDAMAGE)
		ORBP A 0 A_SpawnItemEx("TPortLightningWaveSpawner",0,0,32,0,0,0,0,0,160)
		TNT1 A 0 A_SetTranslucent(0.7,1)
		ORBP ABCDCB 1 bright Light("TPortNormal") A_RadiusThrust(-700,1000, RTF_NOIMPACTDAMAGE)
		ORBP A 0 A_SpawnItemEx("TPortLightningWaveSpawner",0,0,32,0,0,0,0,0,160)
		TNT1 A 0 A_SetTranslucent(0.6,1)
		ORBP ABCDCB 1 bright Light("TPortNormal") A_RadiusThrust(-700,1000, RTF_NOIMPACTDAMAGE)
		ORBP A 0 A_SpawnItemEx("TPortLightningWaveSpawner",0,0,32,0,0,0,0,0,160)
		TNT1 A 0 A_SetTranslucent(0.5,1)
		ORBP ABCDCB 1 bright Light("TPortNormal") A_RadiusThrust(-700,1000, RTF_NOIMPACTDAMAGE)
		ORBP A 0 A_SpawnItemEx("TPortLightningWaveSpawner",0,0,32,0,0,0,0,0,160)
		TNT1 A 0 A_SetTranslucent(0.4,1)
		ORBP ABCDCB 1 bright Light("TPortNormal") A_RadiusThrust(-700,1000, RTF_NOIMPACTDAMAGE)
		ORBP A 0 A_SpawnItemEx("TPortLightningWaveSpawner",0,0,32,0,0,0,0,0,160)
		TNT1 A 0 A_SetTranslucent(0.3,1)
		ORBP ABCDCB 1 bright Light("TPortNormal") A_RadiusThrust(-700,1000, RTF_NOIMPACTDAMAGE)
		ORBP A 0 A_SpawnItemEx("TPortLightningWaveSpawner",0,0,32,0,0,0,0,0,160)
		TNT1 A 0 A_SetTranslucent(0.2,1)
		ORBP ABCDCB 1 bright Light("TPortNormal") A_RadiusThrust(-700,1000, RTF_NOIMPACTDAMAGE)
		ORBP A 0 A_SpawnItemEx("TPortLightningWaveSpawner",0,0,32,0,0,0,0,0,160)
		TNT1 A 0 A_SetTranslucent(0.1,1)
		TNT1 AAA 7 A_SpawnItemEx("TPortLightningWaveSpawner",0,0,32,0,0,0,0,0,144)
		goto Inactivated
	Inactivated:
		TNT1 A 1
		loop
	}
}

// Spawn this for a permanent portal
Actor TPortalPermanent : TPortal // Add a DoomEdNumber as necessary
{
	States
	{
	Spawn:
		goto Activated
	}
}

Actor BlackHole : TPortal // Add a DoomEdNumber as necessary
{
Radius 20
Height 20
Speed 0
SpawnID 176
Projectile
//+NOCLIP
+NOBLOCKMAP
+DONTHARMSPECIES
//+BLOCKEDBYSOLIDACTORS
+NODAMAGETHRUST
-THRUGHOST
+Ripper
+NOBOSSRIP
+ForcePain
+FORCEXYBILLBOARD
+FORCERADIUSDMG
-EXTREMEDEATH
+NOEXTREMEDEATH
Damagetype BlackHole
Scale 0.5
ReactionTime 48		//was 30
Obituary "%o got absorbed by the darkness."
renderstyle NORMAL	//WAS ADD
ALPHA 1.0
	States
	{
	Spawn:
		TNT1 A 0 A_CountDown
		//TNT1 AAAAA 7 A_SpawnItemEx("TPortLightningWaveSpawner",0,0,32,0,0,0,0,0,172)
	//	TNT1 A 0 A_SetTranslucent(0.1,1)
		TNT1 A 0 A_PlaySound("TPortalAppear")
		TNT1 A 0 A_PlaySoundEx("BHole/Suck","Voice",1)
		ORBP A 1 bright Light("TPortNormal") A_RadiusThrust(-1000,1500, RTF_NOIMPACTDAMAGE)
		EXPL A 0 Radius_Quake (3, 60, 0, 11, 0)
		TNT1 A 0 A_Explode(18,150)
		ORBP A 0 A_SpawnItemEx("PurpleShockWave",0,0,55,0,0,0,0,0,160)
		//TNT1 A 0 A_SetTranslucent(0.2,1)
		ORBP B 1 bright Light("TPortNormal") A_RadiusThrust(-1000,1500, RTF_NOIMPACTDAMAGE)
		TNT1 A 0 A_Explode(18,150)
		ORBP A 0 A_SpawnItemEx("PurpleShockWave",0,0,55,0,0,0,0,0,160)
		//TNT1 A 0 A_SetTranslucent(0.3,1)
		ORBP C 1 bright Light("TPortNormal") A_RadiusThrust(-1000,1500, RTF_NOIMPACTDAMAGE)
		EXPL A 0 Radius_Quake (3, 60, 0, 11, 0)
		TNT1 A 0 A_Explode(18,150)
		ORBP A 0 A_SpawnItemEx("PurpleShockWave",0,0,55,0,0,0,0,0,160)
		//TNT1 A 0 A_SetTranslucent(0.4,1)
		ORBP D 1 bright Light("TPortNormal") A_RadiusThrust(-1000,1500, RTF_NOIMPACTDAMAGE)
		TNT1 A 0 A_Explode(18,150)
		ORBP A 0 A_SpawnItemEx("PurpleShockWave",0,0,55,0,0,0,0,0,160)
	//	TNT1 A 0 A_SetTranslucent(0.5,1)
		ORBP A 1 bright Light("TPortNormal") A_RadiusThrust(-1000,1500, RTF_NOIMPACTDAMAGE)
		EXPL A 0 Radius_Quake (3, 60, 0, 11, 0)
		TNT1 A 0 A_Explode(18,150)
		ORBP A 0 A_SpawnItemEx("PurpleShockWave",0,0,55,0,0,0,0,0,160)
		//TNT1 A 0 A_SetTranslucent(0.6,1)
		ORBP B 1 bright Light("TPortNormal") A_RadiusThrust(-1000,1500, RTF_NOIMPACTDAMAGE)
		TNT1 A 0 A_Explode(18,150)
		ORBP A 0 A_SpawnItemEx("PurpleShockWave",0,0,55,0,0,0,0,0,160)
		//TNT1 A 0 A_SetTranslucent(0.7,1)
		ORBP C 1 bright Light("TPortNormal") A_RadiusThrust(-1000,1500, RTF_NOIMPACTDAMAGE)
		EXPL A 0 Radius_Quake (3, 60, 0, 11, 0)
		TNT1 A 0 A_Explode(18,150)
		ORBP A 0 A_SpawnItemEx("PurpleShockWave",0,0,55,0,0,0,0,0,160)
	//	TNT1 A 0 A_SetTranslucent(0.8,1)
		ORBP D 1 bright Light("TPortNormal") A_RadiusThrust(-1000,1500, RTF_NOIMPACTDAMAGE)
		EXPL A 0 Radius_Quake (3, 60, 0, 11, 0)
		TNT1 A 0 A_Explode(18,150)
		ORBP A 0 A_SpawnItemEx("PurpleShockWave",0,0,55,0,0,0,0,0,160)
	//	TNT1 A 0 A_SetTranslucent(0.8,1)
		Loop
	Death:
		TNT1 A 0 A_StopSoundEx("Voice")
		TNT1 A 0 A_PlaySound("TPortalFade",0)
		TNT1 A 0 A_SpawnItemEx("BHSmoke",0,0,64)
		TNT1 A 0 A_SpawnItemEx("BHExplosion",0,0,64)
		TNT1 A 0 A_PlaySound("BHole/Explosion", 1)
		TNT1 A 0 Bright A_SpawnItemEX("PurpleShockWave",0,0,55)//PurpleTrailSparks
		BHOL AAAAAAAAAAAAAA 0 A_SpawnItemEx("PurpleTrailSparks",0,0,55,0,0,0,0,SXF_NOCHECKPOSITION)
		BHOL A 1 Light("BHOLE_2") A_FadeOut(0.08)
		BHOL B 1 Light("BHOLE_3") A_FadeOut(0.08)
		BHOL C 1 Light("BHOLE_4") A_FadeOut(0.08)
		BHOL D 1 Light("BHOLE_5") A_FadeOut(0.08)
		BHOL E 1 Light("BHOLE_6") A_FadeOut(0.08)
		BHOL F 1 Light("BHOLE_7") A_FadeOut(0.08)
		BHOL G 1 Light("BHOLE_8") A_FadeOut(0.08)
		BHOL H 1 Light("BHOLE_9") A_FadeOut(0.08)
		BHOL I 1 Light("BHOLE_10") A_FadeOut(0.08)
		Stop
	}
}

ACTOR PurpleTrailSparks
{
RenderStyle Add
Scale 0.022
Alpha 0.95
+NOINTERACTION
+NOGRAVITY
	States
	{
	Spawn:
		YA36 A 0 NoDelay A_JumpIf(ScaleX <= 0, "NULL")
		YA36 A 0 A_SetScale(ScaleX-0.00075)
		YA36 A 3 bright A_ChangeVelocity (frandom(-0.8, 0.8), frandom(-0.8, 0.8), frandom(-0.8, 0.8), 0)
		YA36 A 1 bright A_FadeOut(0.05)
		Loop
	}
}

//***************//
// Support Actors//
//***************//

Actor VisualSpecialEffect
{
	+CLIENTSIDEONLY
	+NOINTERACTION
	+NOBLOCKMAP
	+NOGRAVITY
	+NOTELEPORT
	+FORCEXYBILLBOARD
}

// A wave of lightning
Actor TPortLightningWave : VisualSpecialEffect
{
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_SpawnItemEx("TPortLightningSmall",Random(-2,2),Random(-2,2),Random(-2,2),0,0,0,0,0,32)
		TNT1 A 0 A_SpawnItemEx("TPortLightningMedium",Random(-3,3),Random(-3,3),Random(-3,3),0,0,0,0,0,56)
		TNT1 A 0 A_SpawnItemEx("TPortLightningLarge",Random(-4,4),Random(-4,4),Random(-3,3),0,0,0,0,0,96)
		TNT1 A 0 A_SpawnItemEx("TPortLightningHuge",Random(-5,5),Random(-5,5),Random(-5,5),0,0,0,0,0,144)
		stop
	}
}

Actor TPortLightning : VisualSpecialEffect
{
	RenderStyle Add
	Alpha 0.7
	States
	{
	Spawn:
		TNT1 A 0 // Huh, that's the jump...
		TNT1 A 0 A_Jump(256,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72)
	Select:
		BLL1 ABCDEFGHIJKLMNOPQR 0 A_Jump(256,"Fade")
		BLL2 ABCDEFGHIJKLMNOPQR 0 A_Jump(256,"Fade")
		BLL3 ABCDEFGHIJKLMNOPQR 0 A_Jump(256,"Fade")
		BLL4 ABCDEFGHIJKLMNOPQR 0 A_Jump(256,"Fade")
	Fade:
		"----" A 1 bright A_FadeOut(0.15)
		loop
	}
}

Actor TPortLightningSmall : TPortLightning
{
	Scale 0.2
}

Actor TPortLightningMedium : TPortLightning
{
	Scale 0.3
}

Actor TPortLightningLarge : TPortLightning
{
	Scale 0.4
}

Actor TPortLightningHuge : TPortLightning
{
	Scale 0.5
}

// Spawns lightning waves
Actor TPortLightningWaveSpawner : VisualSpecialEffect
{
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_PlaySound("TPortalZap")
		TNT1 A 2 Light("TPortZap") A_SpawnItem("TPortLightningWave")
		TNT1 A 1 Light("TPortZap") A_SpawnItem("TPortLightningWave")
		TNT1 A 3 Light("TPortZap") A_SpawnItem("TPortLightningWave")
		TNT1 A 5 Light("TPortZap") A_SpawnItem("TPortLightningWave")
		TNT1 A 1 Light("TPortZap") A_SpawnItem("TPortLightningWave")
		TNT1 A 2 Light("TPortZap") A_SpawnItem("TPortLightningWave")
		TNT1 A 4 A_SpawnItem("TPortLightningWave")
		stop
	}
}