ACTOR "Demon Technology D-BFG10K" : Weapon
{
Height 20
Weapon.Selectionorder 2820
Weapon.SlotNumber 7
Weapon.SlotPriority 1
Weapon.Kickback 100
Weapon.AmmoUse 40
Weapon.AmmoGive 150
Weapon.AmmoType "DCell"
Scale 0.85
Weapon.PreferredSkin "DBFG-Marine"
Decal "DBFGLightning"
Inventory.PickupSound "weapons/dtech10kpickup"
Inventory.PickupMessage "Demon Technology D-BFG10K"
Obituary "%o had no chance against %k's Demon Technology D-BFG10K."
+INVENTORY.UNDROPPABLE
+WEAPON.NOAUTOFIRE
+WEAPON.BFG
States
{
Select:   
	TNT1 A 0 A_JumpIfNoAmmo("Select2")
    TNT1 A 0 A_PlayWeaponSound("weapons/dtech10kpickup")
    z004 A 1 A_Raise
    Goto Select+2
Select2:   
    TNT1 A 0 A_PlayWeaponSound("weapons/dtech10kpickup")
    z002 A 1 A_Raise
    Goto Select2+1	
Deselect:
	TNT1 A 0 A_TakeInventory("HandGrenadeAction",1)
	TNT1 A 0 A_TakeInventory("MineAction",1)
	TNT1 A 0 A_TakeInventory("RailgunAction",1)
	TNT1 A 0 A_JumpIfNoAmmo("Deselect2")
	TNT1 A 0 A_PlayWeaponSound("weapons/weapondown")
	z004 A 1 A_Lower
    Goto Deselect+5
Deselect2:
	TNT1 A 0 A_PlayWeaponSound("weapons/weapondown")
	z002 A 1 A_Lower
    Goto Deselect2+1	
Ready:
    TNT1 A 0 A_JumpIfNoAmmo("Ready2")
	TNT1 A 0 A_PlayWeaponSound("Weapons/dbfgready")
    z004 AAABBCCBB 1 A_WeaponReady     
    Loop
Ready2:
    TNT1 A 0 A_JumpIfInventory("DCell",100,"Ready")
	z002 A 1 A_WeaponReady
	Loop
Fire:
	TNT1 A 0 A_Light1
    TNT1 A 0 A_PlayWeaponSound("Cardinal/9k")
	z003 C 2 Bright Radius_Quake(1,2,0,1,0)
    z003 DE 2 Bright Radius_Quake(2,2,0,1,0)
    z003 FGH 2 Bright Radius_Quake(4,2,0,1,0)
	z003 IJK 1 Bright Radius_Quake(6,3,0,1,0)
	z003 L 15 Bright Radius_Quake(8,3,0,1,0)
	TNT1 A 0 A_Light2
    TNT1 A 0 A_GunFlash	
	z003 M 2 Bright Radius_Quake(10,4,0,1,0)
	TNT1 A 0 A_Recoil(10)	
	TNT1 A 0 Radius_Quake(12,6,0,1,0)
	z003 N 2 Bright A_FireCustomMissile("DemonTechnologyDTBFG10000Ball",0,1,0,0)	
	z003 OP 1 Bright
	TNT1 A 0 A_Light0
	z003 QRST 2 Bright
	TNT1 A 0 Radius_Quake(3,10,0,1,0)
	TNT1 A 0 A_PlaySound("weapons/dtech10ksteam")
	z002 AAAAAAAAAAAA 1 A_FireCustomMissile("DTech10KSteam",-58+Random(-4,4),0,0,0)
	z002 A 20
	TNT1 A 0 A_JumpIfInventory("DCell",100,1)
	Goto Ready2
	z002 A 60 A_PlayWeaponSound("weapons/dtech10kcharge")
	z002 A 10 A_PlayWeaponSound("weapons/plasmacellin")
	Goto Ready
Spawn:
    z001 A -1
    Stop   
    }
}

ACTOR DemonTechnologyDTBFG10000Ball
{
Radius 20
Height 30
Damage 100
Speed 18
Alpha 0.95
Scale 0.55
MissileType "DemonTechnologyDTBFG10000BallRatyiTrail"
RENDERSTYLE Translucent
Alpha 0.85
PROJECTILE
+FORCERADIUSDMG
+THRUSPECIES
Species "Player"
Obituary "%o had no chance against %k's Demon Technology D-BFG10K."
DeathSound ""
Decal DBFGLightning
States
{
Spawn:
    TNT1 A 0
    TNT1 A 0 A_AlertMonsters
 	TNT1 A 0 A_SpawnItemEx("SpecialBlueDTBFG10KFireparticleBig",-12,frandom(-2,2),frandom(-2,2),frandom(-2,0))
	TNT1 A 0 A_SpawnItemEx("SpecialBlueDTBFG10KSmokeparticleBig",-22,frandom(-2,2),frandom(-2,2),frandom(-5,0),frandom(-2,2),frandom(-2,2))
    TNT1 A 0 A_PlaySoundEx("weapons/dtech10kball","Voice",1)
    TNT1 A 0 A_SpawnItemEx("T3DBFGBallParticle",random(-1,1),random(-1,1),random(-1,1),frandom(-1.0,1.0),frandom(-1.0,1.0),frandom(-1.0,1.0),random(0,359))
    TNT1 A 0 A_SpawnItemEx("T3DBFGBallParticleFloater",random(-12,12),random(-12,12),random(12,22),random(-2,2),random(-2,2),random(-2,2),random(-20,20),SXF_NOCHECKPOSITION|SXF_CLIENTSIDE,0)
    TNT1 A 0 A_SpawnItemEx("BFGTrailParticleBlueish",Random(-12,12),Random(-12,12),Random(12,22),Random(-2,2),Random(-2,2),Random(-2,2),Random(-20,20),128)
    Z005 A 1 Bright A_SpawnItemEx("T3DBFGShockAttack",0,0,0,0,0,0,0,SXF_SETMASTER)
    Z005 A 0 Bright A_SpawnItemEx("SOMERAILFROMUPONDEADLYDTDBFG10K",0,0,0,0,0,0,0,SXF_SETMASTER)
 	TNT1 A 0 A_SpawnItemEx("SpecialBlueDTBFG10KFireparticleBig",-12,frandom(-2,2),frandom(-2,2),frandom(-2,0))
	TNT1 A 0 A_SpawnItemEx("SpecialBlueDTBFG10KSmokeparticleBig",-22,frandom(-2,2),frandom(-2,2),frandom(-5,0),frandom(-2,2),frandom(-2,2))
    TNT1 A 0 A_SpawnItemEx("T3DBFGBallParticle",random(-1,1),random(-1,1),random(-1,1),frandom(-1.0,1.0),frandom(-1.0,1.0),frandom(-1.0,1.0),random(0,359))
    TNT1 A 0 A_SpawnItemEx("T3DBFGBallParticleFloater",random(-12,12),random(-12,12),random(12,22),random(-2,2),random(-2,2),random(-2,2),random(-20,20),SXF_NOCHECKPOSITION|SXF_CLIENTSIDE,0)
    TNT1 A 0 A_SpawnItemEx("BFGTrailParticleBlueish",Random(-12,12),Random(-12,12),Random(12,22),Random(-2,2),Random(-2,2),Random(-2,2),Random(-20,20),128)
    Z005 B 1 Bright A_SpawnItemEx("T3DBFGShockAttack",0,0,0,0,0,0,0,SXF_SETMASTER)
	TNT1 A 0 A_Jump(9999,"DTBFGSFX")
    Z005 B 0 Bright A_SpawnItemEx("SOMERAILFROMUPONDEADLYDTDBFG10K",0,0,0,0,0,0,0,SXF_SETMASTER)
 	TNT1 A 0 A_SpawnItemEx("SpecialBlueDTBFG10KFireparticleBig",-12,frandom(-2,2),frandom(-2,2),frandom(-2,0))
	TNT1 A 0 A_SpawnItemEx("SpecialBlueDTBFG10KSmokeparticleBig",-22,frandom(-2,2),frandom(-2,2),frandom(-5,0),frandom(-2,2),frandom(-2,2))
    TNT1 A 0 A_SpawnItemEx("T3DBFGBallParticle",random(-1,1),random(-1,1),random(-1,1),frandom(-1.0,1.0),frandom(-1.0,1.0),frandom(-1.0,1.0),random(0,359))
    TNT1 A 0 A_SpawnItemEx("T3DBFGBallParticleFloater",random(-12,12),random(-12,12),random(12,22),random(-2,2),random(-2,2),random(-2,2),random(-20,20),SXF_NOCHECKPOSITION|SXF_CLIENTSIDE,0)
    TNT1 A 0 A_SpawnItemEx("BFGTrailParticleBlueish",Random(-12,12),Random(-12,12),Random(12,22),Random(-2,2),Random(-2,2),Random(-2,2),Random(-20,20),128)
    Z005 C 1 Bright A_SpawnItemEx("T3DBFGShockAttack",0,0,0,0,0,0,0,SXF_SETMASTER)
    Z005 C 0 Bright A_SpawnItemEx("SOMERAILFROMUPONDEADLYDTDBFG10K",0,0,0,0,0,0,0,SXF_SETMASTER)
 	TNT1 A 0 A_SpawnItemEx("SpecialBlueDTBFG10KFireparticleBig",-12,frandom(-2,2),frandom(-2,2),frandom(-2,0))
	TNT1 A 0 A_SpawnItemEx("SpecialBlueDTBFG10KSmokeparticleBig",-22,frandom(-2,2),frandom(-2,2),frandom(-5,0),frandom(-2,2),frandom(-2,2))
    TNT1 A 0 A_SpawnItemEx("T3DBFGBallParticle",random(-1,1),random(-1,1),random(-1,1),frandom(-1.0,1.0),frandom(-1.0,1.0),frandom(-1.0,1.0),random(0,359))
    TNT1 A 0 A_SpawnItemEx("T3DBFGBallParticleFloater",random(-12,12),random(-12,12),random(12,22),random(-2,2),random(-2,2),random(-2,2),random(-20,20),SXF_NOCHECKPOSITION|SXF_CLIENTSIDE,0)
    TNT1 A 0 A_SpawnItemEx("BFGTrailParticleBlueish",Random(-12,12),Random(-12,12),Random(12,22),Random(-2,2),Random(-2,2),Random(-2,2),Random(-20,20),128)
    Z005 D 1 Bright A_SpawnItemEx("T3DBFGShockAttack",0,0,0,0,0,0,0,SXF_SETMASTER)
    Z005 D 0 Bright A_SpawnItemEx("SOMERAILFROMUPONDEADLYDTDBFG10K",0,0,0,0,0,0,0,SXF_SETMASTER)
 	TNT1 A 0 A_SpawnItemEx("SpecialBlueDTBFG10KFireparticleBig",-12,frandom(-2,2),frandom(-2,2),frandom(-2,0))
	TNT1 A 0 A_SpawnItemEx("SpecialBlueDTBFG10KSmokeparticleBig",-22,frandom(-2,2),frandom(-2,2),frandom(-5,0),frandom(-2,2),frandom(-2,2))
    TNT1 A 0 A_SpawnItemEx("T3DBFGBallParticle",random(-1,1),random(-1,1),random(-1,1),frandom(-1.0,1.0),frandom(-1.0,1.0),frandom(-1.0,1.0),random(0,359))
    TNT1 A 0 A_SpawnItemEx("T3DBFGBallParticleFloater",random(-12,12),random(-12,12),random(12,22),random(-2,2),random(-2,2),random(-2,2),random(-20,20),SXF_NOCHECKPOSITION|SXF_CLIENTSIDE,0)
    Loop
DTBFGSFX:
    TNT1 A 0 A_AlertMonsters
    TNT1 A 0 A_PlaySoundEx("weapons/dtech10kball","Voice",1)
    TNT1 A 0 A_SpawnItemEx("T3DBFGBallParticle",random(-1,1),random(-1,1),random(-1,1),frandom(-1.0,1.0),frandom(-1.0,1.0),frandom(-1.0,1.0),random(0,359))
    TNT1 A 0 A_SpawnItemEx("T3DBFGBallParticleFloater",random(-12,12),random(-12,12),random(12,22),random(-2,2),random(-2,2),random(-2,2),random(-20,20),SXF_NOCHECKPOSITION|SXF_CLIENTSIDE,0)
	TNT1 A 0 A_SpawnItemEx("T3DBFGBallLightningBolt",Random(6,-6),Random(6,-6),Random(16,8),0,0,0,0,128)
    TNT1 A 0 A_SpawnItemEx("BFGTrailParticleBlueish",Random(-12,12),Random(-12,12),Random(12,22),Random(-2,2),Random(-2,2),Random(-2,2),Random(-20,20),128)
    Z005 A 1 Bright A_SpawnItemEx("T3DBFGShockAttack",0,0,0,0,0,0,0,SXF_SETMASTER)
    Z005 A 0 Bright A_SpawnItemEx("SOMERAILFROMUPONDEADLYDTDBFG10K",0,0,0,0,0,0,0,SXF_SETMASTER)
 	TNT1 A 0 A_SpawnItemEx("SpecialBlueDTBFG10KFireparticleBig",-12,frandom(-2,2),frandom(-2,2),frandom(-2,0))
	TNT1 A 0 A_SpawnItemEx("SpecialBlueDTBFG10KSmokeparticleBig",-22,frandom(-2,2),frandom(-2,2),frandom(-5,0),frandom(-2,2),frandom(-2,2))
    TNT1 A 0 A_SpawnItemEx("T3DBFGBallParticle",random(-1,1),random(-1,1),random(-1,1),frandom(-1.0,1.0),frandom(-1.0,1.0),frandom(-1.0,1.0),random(0,359))
    TNT1 A 0 A_SpawnItemEx("T3DBFGBallParticleFloater",random(-12,12),random(-12,12),random(12,22),random(-2,2),random(-2,2),random(-2,2),random(-20,20),SXF_NOCHECKPOSITION|SXF_CLIENTSIDE,0)
	TNT1 A 0 A_SpawnItemEx("T3DBFGBallLightningBolt",Random(6,-6),Random(6,-6),Random(16,8),0,0,0,0,128)
    TNT1 A 0 A_SpawnItemEx("BFGTrailParticleBlueish",Random(-12,12),Random(-12,12),Random(12,22),Random(-2,2),Random(-2,2),Random(-2,2),Random(-20,20),128)
    Z005 B 1 Bright A_SpawnItemEx("T3DBFGShockAttack",0,0,0,0,0,0,0,SXF_SETMASTER)
    Z005 B 0 Bright A_SpawnItemEx("SOMERAILFROMUPONDEADLYDTDBFG10K",0,0,0,0,0,0,0,SXF_SETMASTER)
 	TNT1 A 0 A_SpawnItemEx("SpecialBlueDTBFG10KFireparticleBig",-12,frandom(-2,2),frandom(-2,2),frandom(-2,0))
	TNT1 A 0 A_SpawnItemEx("SpecialBlueDTBFG10KSmokeparticleBig",-22,frandom(-2,2),frandom(-2,2),frandom(-5,0),frandom(-2,2),frandom(-2,2))
    TNT1 A 0 A_SpawnItemEx("T3DBFGBallParticle",random(-1,1),random(-1,1),random(-1,1),frandom(-1.0,1.0),frandom(-1.0,1.0),frandom(-1.0,1.0),random(0,359))
    TNT1 A 0 A_SpawnItemEx("T3DBFGBallParticleFloater",random(-12,12),random(-12,12),random(12,22),random(-2,2),random(-2,2),random(-2,2),random(-20,20),SXF_NOCHECKPOSITION|SXF_CLIENTSIDE,0)
	TNT1 A 0 A_SpawnItemEx("T3DBFGBallLightningBolt",Random(6,-6),Random(6,-6),Random(16,8),0,0,0,0,128)
    TNT1 A 0 A_SpawnItemEx("BFGTrailParticleBlueish",Random(-12,12),Random(-12,12),Random(12,22),Random(-2,2),Random(-2,2),Random(-2,2),Random(-20,20),128)
    Z005 C 1 Bright A_SpawnItemEx("T3DBFGShockAttack",0,0,0,0,0,0,0,SXF_SETMASTER)
    Z005 C 0 Bright A_SpawnItemEx("SOMERAILFROMUPONDEADLYDTDBFG10K",0,0,0,0,0,0,0,SXF_SETMASTER)
 	TNT1 A 0 A_SpawnItemEx("SpecialBlueDTBFG10KFireparticleBig",-12,frandom(-2,2),frandom(-2,2),frandom(-2,0))
	TNT1 A 0 A_SpawnItemEx("SpecialBlueDTBFG10KSmokeparticleBig",-22,frandom(-2,2),frandom(-2,2),frandom(-5,0),frandom(-2,2),frandom(-2,2))
    TNT1 A 0 A_SpawnItemEx("T3DBFGBallParticle",random(-1,1),random(-1,1),random(-1,1),frandom(-1.0,1.0),frandom(-1.0,1.0),frandom(-1.0,1.0),random(0,359))
    TNT1 A 0 A_SpawnItemEx("T3DBFGBallParticleFloater",random(-12,12),random(-12,12),random(12,22),random(-2,2),random(-2,2),random(-2,2),random(-20,20),SXF_NOCHECKPOSITION|SXF_CLIENTSIDE,0)
	TNT1 A 0 A_SpawnItemEx("T3DBFGBallLightningBolt",Random(6,-6),Random(6,-6),Random(16,8),0,0,0,0,128)
    TNT1 A 0 A_SpawnItemEx("BFGTrailParticleBlueish",Random(-12,12),Random(-12,12),Random(12,22),Random(-2,2),Random(-2,2),Random(-2,2),Random(-20,20),128)
    Z005 D 1 Bright A_SpawnItemEx("T3DBFGShockAttack",0,0,0,0,0,0,0,SXF_SETMASTER)
    Z005 D 0 Bright A_SpawnItemEx("SOMERAILFROMUPONDEADLYDTDBFG10K",0,0,0,0,0,0,0,SXF_SETMASTER)
 	TNT1 A 0 A_SpawnItemEx("SpecialBlueDTBFG10KFireparticleBig",-12,frandom(-2,2),frandom(-2,2),frandom(-2,0))
	TNT1 A 0 A_SpawnItemEx("SpecialBlueDTBFG10KSmokeparticleBig",-22,frandom(-2,2),frandom(-2,2),frandom(-5,0),frandom(-2,2),frandom(-2,2))
    TNT1 A 0 A_SpawnItemEx("T3DBFGBallParticle",random(-1,1),random(-1,1),random(-1,1),frandom(-1.0,1.0),frandom(-1.0,1.0),frandom(-1.0,1.0),random(0,359))
    TNT1 A 0 A_SpawnItemEx("T3DBFGBallParticleFloater",random(-12,12),random(-12,12),random(12,22),random(-2,2),random(-2,2),random(-2,2),random(-20,20),SXF_NOCHECKPOSITION|SXF_CLIENTSIDE,0)
    Goto Spawn
Death:
    TNT1 A 0
	TNT1 A 0 A_SetTranslucent(0.75,1)
	TNT1 A 0 Radius_Quake(5,60,0,10,0)
	TNT1 A 0 Bright
	TNT1 A 0 A_Explode(480,240)
	TNT1 A 0 A_StopSoundEx("Voice")
	TNT1 A 0 Radius_Quake(15,20,0,20,0)
	TNT1 A 0 Bright A_SpawnItemEx("PlayerT3DBFGBoltExp")
	TNT1 A 0 Bright A_Explode(256,256,0,false,128)
	TNT1 A 0 Bright A_Quake(4,35*2,0,4096, none)
	TNT1 A 8 Bright
	TNT1 A 0 Bright A_Explode(256,384,0,false,128)
	TNT1 A 8 Bright
	TNT1 A 0 Bright A_Explode(256,512,0,false,256)
	TNT1 A 8 Bright A_BFGSpray("PlayerT3DBFGExtra",40,30)
	TNT1 A 0 A_PlaySound("weapons/dtech10kexplode")
	TNT1 A 0 Bright A_Explode(256,512,0,false,256)
	TNT1 A 8 Bright
	TNT1 A 0 Bright A_Explode(256,512,0,false,256)
	TNT1 A 8 Bright
	TNT1 A 0 Bright A_Explode(256,512,0,false,256)
	TNT1 A 8 Bright
	TNT1 A 1 Bright A_Explode(256,512,0,false,256)
	TNT1 A 10 Bright
    Stop    
    }
}
ACTOR BFGTrailParticleBlueish : BFGTrailParticleGreen
{
Scale 0.06
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "Toaster")
z006 AB 2 Bright A_FadeOut(0.015)
Loop
}
}

ACTOR T3DBFGBallLightningBolt
{
RenderStyle Add
Scale 0.24
Alpha 0.5
+MISSILE
+NOGRAVITY
+NOBLOCKMAP
+NOINTERACTION
+NOTELEPORT
+DONTSPLASH
+CLIENTSIDEONLY
-SOLID
States
{
Spawn:
	TNT1 A 0
	TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "Toaster")
	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)
	HBL1 ABCDEFGHIJKLMNOPQR 0 Bright A_Jump(256,"Death")
	HBL2 ABCDEFGHIJKLMNOPQR 0 Bright A_Jump(256,"Death")
	HBL3 ABCDEFGHIJKLMNOPQR 0 Bright A_Jump(256,"Death")
	HBL4 ABCDEFGHIJKLMNOPQR 0 Bright A_Jump(256,"Death")
Death:
	"----" A 1 Bright
	Stop
Toaster:
	TNT1 A 0
	Stop
	}
}

ACTOR SOMERAILFROMUPONDEADLYDTDBFG10K
{
PROJECTILE
+LOOKALLAROUND
+ISMONSTER
+QUICKTORETALIATE
+NOTARGET
+FRIENDLY
+NOCLIP
Obituary "%o had no chance against %k's Demon Technology D-BFG10K."
MissileType "PlayerDTBFGRailgunSlug"
States
{
Spawn:
    TNT1 A 0
	TNT1 AAAAA 1 A_Look
	Stop
See:
    TNT1 A 0
	TNT1 A 1 A_JumpIfCloser(1250,"Attack")
	Stop
Attack:
    TNT1 A 0
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_MissileAttack
	TNT1 A 1 A_CustomRailgun(-1,0,NONE,"00 99 FF",1,1,2)
	Goto Death	
Death:
	TNT1 A 1
	Stop
	}
}

Actor DemonTechnologyDTBFG10000BallRatyiTrail
{
  +NoBlockMap
  +NoGravity
  +float
  Scale 0.55
  RenderStyle Add
  Radius 30
  Height 30
  States
  {
  Spawn:
    Z005 A 1 bright A_FadeOut(0.1)
    Loop
  }
}

Actor SpecialBlueDTBFG10KFireparticleBig
{
Damage 120
Species "Player"
DamageType "DTBFG"
RenderStyle Add
Scale 0.10
Alpha 0.65
+CLIENTSIDEONLY
+NOGRAVITY
States
{
Spawn:
z007 BBCCDD 1 Bright A_FadeOut(0.1)
Stop
}
}

Actor SpecialBlueDTBFG10KSmokeparticleBig
{
Damage 120
Species "Player"
DamageType "DTBFG"
RenderStyle Add
Scale 0.10
Alpha 0.65
+CLIENTSIDEONLY
+NOGRAVITY
States
{
Spawn:
z008 AABBCC 1 Bright A_FadeOut(0.1)
Stop
}
}
