//=================================================================================================
//
// Minigun
//
//=================================================================================================

ACTOR Minigun : Weapon 5014
{
	Game Doom
	Weapon.AmmoType "Clip" 
	Weapon.AmmoGive 20
	Weapon.AmmoUse 1
	Weapon.Selectionorder 700
	Weapon.Kickback 100
	Inventory.PickupMessage "$PICKUP_MINIGUN"
	Obituary "$OB_MINIGUN"
	AttackSound "weapons/minigun"
	SpawnID 214
	Radius 20
	Height 16
	States
	{
	Spawn:
		MNGN A -1
		Loop
	Ready:
		MNGG A 1 A_WeaponReady
		Loop
	Deselect:
		MNGG A 1 A_Lower
		Loop
	Select: 
		MNGG A 1 A_Raise 
		Loop 
	Fire: 
		MNGG A 0 A_GunFlash
		MNGG A 2 A_FireBullets(5.6, 0, 1, 5, "BulletPuff")
		MNGG B 2 A_FireBullets(5.6, 0, 1, 5, "BulletPuff")
		MNGG A 2 A_ReFire
		MNGG B 2
		MNGG A 4
		MNGG B 4
		MNGG A 8
		MNGG B 8
		goto Ready 
	Flash: 
		MNGF A 3 BRIGHT A_Light1 
		MNGF B 3 BRIGHT A_Light0
		Stop 
	}
}

//=================================================================================================
//
// RailGun
//
//=================================================================================================

ACTOR RailGun : DoomWeapon 5012
{
	Game Doom
	SpawnID 164
	Radius 20
	Height 16
	Weapon.Selectionorder 100
	Weapon.AmmoUse 10
	Weapon.AmmoGive 40
	Weapon.AmmoType "Cell"
	Inventory.Pickupmessage "$PICKUP_RAILGUN"
	Obituary "$OB_RAILGUN"
	States
	{
	Ready:
		RLGG A 1 A_WeaponReady
		loop
	Deselect:
		RLGG A 1 A_Lower
		loop
	Select:
		RLGG A 1 A_Raise
		loop
	Fire:
		RLGG E 12 A_FireRailgun ("RailgunPuff")
		RLGG F 6 A_CheckRailReload
		RLGG G 6
		RLGG H 6
		RLGG I 6
		RLGG J 6
		RLGG K 6
		RLGG L 6
		RLGG A 6
		RLGG M 0 A_ReFire
		goto Ready
	Flash:
		TNT1 A 5 bright A_Light1
		TNT1 A 5 bright A_Light2
		TNT1 A 0 bright A_Light0
		Goto LightDone
	Spawn:
		RAIL A -1
		stop
	}
}

//=================================================================================================
//
// [TP] This allows the railgun to pierce armor
//
//=================================================================================================
ACTOR RailgunPuff : BulletPuff
{
	DamageType Railgun
	+PIERCEARMOR
	States
	{
	Spawn:
	Melee:
		TNT1 A 1
		stop
	}
}

//=================================================================================================
//
// BFG10K
//
//=================================================================================================

ACTOR BFG10K : DoomWeapon 5013
{
	Game Doom
	SpawnID 165
	Radius 20
	Height 20
	Weapon.Selectionorder 2800
	Weapon.AmmoUse 5
	Weapon.AmmoGive 40
	Weapon.AmmoType "Cell"
	Weapon.Kickback 100
	Inventory.Pickupmessage "$PICKUP_BFG10K"
	+WEAPON.NOAUTOFIRE
	+WEAPON.NOLMS
	States
	{
	Spawn:
		BFG2 A -1
		stop
	Ready:
		BG2G A 0 A_PlaySound ("weapons/bfg10kidle")
		BG2G A 1 A_WeaponReady
		BG2G A 1 A_WeaponReady
		BG2G A 1 A_WeaponReady
		BG2G B 1 A_WeaponReady
		BG2G B 1 A_WeaponReady
		BG2G B 1 A_WeaponReady
		BG2G C 1 A_WeaponReady
		BG2G C 1 A_WeaponReady
		BG2G C 1 A_WeaponReady
		BG2G D 1 A_WeaponReady
		BG2G D 1 A_WeaponReady
		BG2G D 1 A_WeaponReady
		loop
	Deselect:
		BG2G E 1 A_Lower
		loop
	Select:
		BG2G E 1 A_Raise
		loop
	Fire:
		BG2G E 20 A_PlaySound ("weapons/bfg10kf")
		BG2G F 4
		BG2G G 1
		BG2G H 1
		BG2G I 1
		BG2G J 1
		goto Hold
	Hold:
		BG2G K 2 A_GunFlash
		BG2G L 2 A_FireBullets(0,0,1,0,"BFG10kShot")
		BG2G M 2
		BG2G N 0 A_ReFire
		BG2G O 35 A_PlaySound ("weapons/bfg10kcool")
		goto Ready
	Flash:
		TNT1 A 2 bright A_Light1
		TNT1 A 3 bright
		Goto LightDone
		stop
	}
}

//=================================================================================================
//
// BFG10K explosive shot
//
//=================================================================================================

ACTOR BFG10kShot
{
	Game Doom
	SpawnID 217
	Radius 11
	Height 8
	Speed 20
	Damage 160
	DamageType BFG10k
	+NOBLOCKMAP
	+NOGRAVITY
	+ACTIVATEIMPACT
	+ACTIVATEPCROSS
	+NOTELEPORT 
	+PUFFONACTORS
	+PUFFGETSOWNER
	+FORCERADIUSDMG
	Renderstyle Add
	Alpha 0.75
	SeeSound "weapons/bfg10kx"
	AttackSound "weapons/bfg10kx"
	Obituary "$OB_BFG10K"
	States
	{
	Spawn:
		BFE1 A 0 bright
		BFE1 A 3 bright A_Detonate
		BFE1 BCDEF 3 bright
		Stop
	}
}

//=================================================================================================
//
// GrenadeLauncher
//
//=================================================================================================

ACTOR GrenadeLauncher : DoomWeapon 5011
{
	Game Doom
	SpawnID 163
	Radius 20
	Height 16
	Weapon.Selectionorder 2500
	+WEAPON.NOAUTOFIRE
	+WEAPON.NOAUTOAIM
	Weapon.AmmoUse 1
	Weapon.AmmoGive 2
	Weapon.AmmoType "RocketAmmo"
	Weapon.Kickback 100
	Inventory.PickupMessage "$PICKUP_GRENADELAUNCHER"

	States
	{
	Spawn:
		GLAU A -1
		stop
	Ready:
		GRLG A 1 A_WeaponReady
		loop
	Deselect:
		GRLG A 1 A_Lower
		loop
	Select: 
		GRLG A 1 A_Raise
		loop
	Fire: 
		GRLG B 8 A_GunFlash
		GRLG B 12 A_FireCustomMissile ( "Grenade", 0, 1, 0, 0, 0, 6.328125 )
		GRLG B 0 A_ReFire
		goto Ready 
	Flash: 
		GRLF A	3 bright A_Light1
		GRLF B	4 bright
		GRLF C 4 bright A_Light2
		GRLF D 4 bright A_Light2
		Goto LightDone
	}
}
