ACTOR TITAN : Weapon replaces BFG9000
{
	Weapon.SlotNumber 7
	Weapon.SelectionOrder 2800
	Weapon.AmmoType "Cell"
	Weapon.AmmoGive 80
	Weapon.AmmoUse 1
	Weapon.AmmoType2 "BFGCell"
	Weapon.AmmoUse2 1
	Obituary "%o went to plaid from %k's Titan"
	Inventory.PickupMessage "You got the Titan! Oh, yes."
	Inventory.PickupSound "weapons/fist/swing"
	Tag "Titan"
	Weapon.BobStyle "Smooth"
	Weapon.BobSpeed 2.0
	Weapon.BobRangeX 0.30
	Weapon.BobRangeY 0.40
	+WEAPON.AMMO_CHECKBOTH
	States
	{
	Ready:
		DBFG A 1 Offset(70,100) A_Playsound("weapons/bfg/pickup")
		DBFG A 1 Offset(65,95)
		DBFG A 1 Offset(60,90)
		DBFG A 1 Offset(55,85)
		DBFG A 1 Offset(50,80)
		DBFG A 1 Offset(45,75)
		DBFG A 1 Offset(40,70)
		DBFG A 1 Offset(35,65)
		DBFG A 1 Offset(30,60)
		DBFG A 1 Offset(25,55)
		DBFG A 1 Offset(20,50)
		DBFG A 1 Offset(15,45)
		DBFG A 1 Offset(10,40)
		DBFG A 1 Offset(5,35)
		DBFG A 1 Offset(0,32)
	ReadyII:
		TNT1 A 0 A_JumpIfInventory("BFGCell",0,2)
		TNT1 A 0 A_JumpIfInventory("Cell",1,2)
		DBFG A 1 A_WeaponReady
		Loop
		DBFG A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		Loop	
	Deselect:
		DBFG A 1 Offset(10,40)
		DBFG A 1 Offset(15,55)
		DBFG A 1 Offset(20,75)
		DBFG A 1 Offset(25,100)
		DBFG A 1 Offset(30,130)
		DBFG A 0 A_Lower
		Wait
	Select:
		DBFG A 0 A_Raise
		Loop
	Fire:
		TNT1 A 0 A_JumpIfInventory("BFGCell",1,1)
		Goto ReloadCheck
		TNT1 A 0 A_GunFlash
		DBFC AB 3
		TNT1 A 0 A_TakeInventory("BFGCell",5,TIF_NOTAKEINFINITE)
		TNT1 A 0 A_PlaySound("weapons/bfg/fire",5)
		TNT1 A 0 A_SetPitch (pitch+0.1)
		DBFF A 1 BRIGHT A_ZoomFactor(0.996)
		DBFF A 1 A_ZoomFactor(0.993)
		TNT1 A 0 A_SetPitch (pitch-0.1)
		TNT1 A 0 A_FireCustomMissile("GunSmokeSpawner",0,0,0,-5)
		TNT1 A 0 A_Light2
		DBFF B 1 A_FireCustomMissile("Nova",0,0,0,0)
		TNT1 A 0 A_ZoomFactor(0.998)
		DBFF B 1 A_Light1
		DBFF B 1 A_Light0
		DBFF B 1 A_ZoomFactor(1.0)
		DBFG CBA 2
		TNT1 A 0 A_Refire
		TNT1 A 0 A_PlayWeaponsound("weapons/plasmagun/beep")
		DBFG ABAB 2
		Goto ReadyII
	Flash:
		BFFL BC 3 Bright
		TNT1 A 8
		BFFL A 2 Bright
		TNT1 A 4	
		BFFL A 2 Bright
		TNT1 A 2
		BFFL A 2 Bright
		Goto LightDone
	AltFire:
		TNT1 A 0 A_JumpIfInventory("BFGCell",1,1)
		Goto ReloadCheck
		TNT1 A 0 A_PlaySound("weapons/bfg/start",5)
		TNT1 A 0 A_PlayWeaponSound("weapons/bfg/classic")
		TNT1 A 0 A_GunFlash
		DBFC ABCD 3 //BRIGHT
		DBFC EFGHIJ 3 //BRIGHT
		DBFF A 4 //BRIGHT
		TNT1 A 0 A_TakeInventory("BFGCell",40,TIF_NOTAKEINFINITE)
		TNT1 AAAAAA 0 A_FireCustomMissile("GunSmokeSpawner",0,0,0,-5)
		TNT1 A 0 A_SetPitch (pitch-0.1)
		TNT1 A 0 A_Light2
		TNT1 A 0 A_ZoomFactor(0.99)
		DBFF B 1 BRIGHT A_FireCustomMissile("HyperNova",0,0,0,0)
		TNT1 A 0 A_ZoomFactor(0.965)
		DBFF B 1 A_LightInverse
		TNT1 A 0 A_ZoomFactor(0.985)
		DBFF B 1 BRIGHT A_Light1
		DBFF B 1 A_ZoomFactor(0.998)
		TNT1 A 0 A_SetPitch (pitch+0.1)
		TNT1 A 0 A_ZoomFactor(1.0)
		DBFG BABAB 6
		TNT1 A 0 A_PlaySound("weapons/plasmagun/beep",7)
		DBFG ABABBB 2
		TNT1 A 0 A_Refire
		Goto ReadyII
	AltFlash:
		BFFL BCDE 3 Bright A_Light2
		BFFL FGHIJK 3 Bright A_Light1
		TNT1 A 8
		BFFL A 6 Bright
		TNT1 A 6
		BFFL A 6 Bright
		TNT1 A 6
		BFFL A 6 Bright
		TNT1 A 2
		BFFL A 2 Bright
		TNT1 A 2
		BFFL A 6 Bright
		Goto LightDone
	Reload:
		TNT1 A 0 A_PlaySound ("weapons/bfg/reload", CHAN_AUTO)
		DBFG A 3 offset(0,34)
		DBFG B 3 offset(0,38)
		DBFG B 3 offset(0,40)
		DBFG B 5 offset(0,44)
		DBFG B 10 offset(0,48)
		DBFG B 10 offset(0,50)
		Goto ReloadLoop
	ReloadCheck:
		TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("TitanReload")==0, "NoReloadLoop")
		Goto Reload
	ReloadLoop:
		TNT1 A 0 A_GiveInventory("BFGCell")
		TNT1 A 0 A_TakeInventory("Cell",1,TIF_NOTAKEINFINITE)
		TNT1 A 0 A_JumpIfInventory("BFGCell",0,"ReloadEnd")
		TNT1 A 0 A_JumpIfInventory("Cell",1,"ReloadLoop")
		Goto ReloadEnd
	NoReloadLoop:
		TNT1 A 0 A_GiveInventory("BFGCell")
		TNT1 A 0 A_TakeInventory("Cell",1,TIF_NOTAKEINFINITE)
		TNT1 A 0 A_JumpIfInventory("BFGCell",0,"ReadyII")
		TNT1 A 0 A_JumpIfInventory("Cell",1,"NoReloadLoop")
		Goto ReadyII
	ReloadEnd:
		DBFG C 10 offset(0,46)
		DBFG C 3 offset(0,40)
		DBFG C 3 offset(0,36)
		DBFG B 2 offset(0,32)
		Goto ReadyII
	Spawn:
		DEBF A -1
		Stop
	}
}

ACTOR HyperNova : BFGBall
{
	Radius 14
	Height 9
	Speed 40
	Alpha 0.95
	Scale 0.6
	Damage 100
	DeathSound "none"
	States
	{
	Spawn:
		BFS1 AB 3 BRIGHT
		Loop
	Death:
		TNT1 A 0 A_SetScale (1.0)
		TNT1 A 0 A_CustomMissile ("Residue", 1, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_PlaySound ("weapons/plasmad/explode",5)
		BFE1 AABBCCDDEEEFFF 2 Bright
		TNT1 A 0 A_SprayDecal ("BFGLightning")
		TNT1 A 0 A_BFGSpray ("BFGExtra", 60, 30)
		TNT1 A 0 A_PlaySound ("weapons/bfgx")
		TNT1 A 0 A_PlaySound ("weapons/plasmad/explode",6)
		QR00 ABCDEF 3 Bright
		TNT1 A 1 A_CustomMissile ("PlasmaSmoke", 1, 0, random (0, 360), 2, random (0, 160))
		Stop
	}
}

ACTOR Nova : BFGBall
{
	Decal "TitanScorch"
	Radius 7
	Height 9
	Speed 50
	Alpha 0.95
	Scale 0.2
	Damage 30
	//Translation "[192]:[207]=[112]:[127]"
	SeeSound	"none"
	DeathSound "weapons/plasmad/explode"
	States
	{
	Spawn:
		BFS1 AB 3 BRIGHT
		Loop
	Death:
		TNT1 A 0 A_SetScale (0.8)
		TNT1 A 0 A_BFGSpray ("BFGExtra", 40, 6)
		TNT1 A 0 A_CustomMissile ("PlasmaSmoke", 1, 0, random (0, 360), 2, random (0, 160))
		VFX3 ABCD 2 Bright
		VFX3 EFGH 3 Bright
		VFX3 IJ 3
		Stop
	}
}

ACTOR Residue : BFGExtra
{
	+NOBLOCKMAP
	+NOGRAVITY
	RenderStyle Add
	Alpha 0.25
	Scale 0.4
	Damage 0
	DamageType "BFGSplash"
	States
	{
	Spawn:
		TNT1 A 0 A_BFGSpray ("BFGExtra", 60, 10)
		TNT1 A 1 A_CustomMissile ("RocketSmoke", 1, 0, random (0, 360), 2, random (0, 160))
		Stop
	}
}

ACTOR BFGCell : Ammo
{
	+IGNORESKILL
	Inventory.MaxAmount 160
}