// Barrage Launcher

ACTOR BarrageLauncher : IDMWeapon
{
	Weapon.SelectionOrder 400
	Weapon.AmmoType "IDMRocketAmmo"
	Weapon.AmmoGive 6
	//Weapon.PreferredSkin "RocketMarine"
	Weapon.AmmoUse 1
	Inventory.PickupSound "misc/w_pkup"
	Inventory.PickupMessage "Barrage Launcher! (Slot 5)"
	Obituary "%o caught %k's artillery."
	Tag "Barrage Launcher"
	Scale 0.9
	+WEAPON.EXPLOSIVE
	+WEAPON.NOLMS
	States
	{
	Spawn:
	  3LAU A -1 Bright
	  Stop
	Ready:
	  3MIS A 1 A_WeaponReady
	  Loop
	Deselect:
	  3MIS A 0 A_Lower
	  3MIS A 0 A_Lower
	  3MIS A 1 A_Lower
	  Loop
	Select:
	  TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
	Sloop:
	  3MIS A 0 A_Raise
	  3MIS A 0 A_Raise
	  3MIS A 1 A_Raise
	  Loop
	Fire:
	  TNT1 A 0 A_GunFlash
	  TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponLevel2", 1, "Level2")
	  TNT1 A 0 A_PlaySound("weapons/brgfire")
	  TNT1 A 0 A_GunFlash("Flash2")
	  TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad")
	Normal:
	  3MIS A 5 A_FireCustomMissile("BigRocket",0,1,0)
	  TNT1 A 0 A_CheckReload
	  TNT1 A 0 A_PlaySound("weapons/brgfire")
	  TNT1 A 0 A_GunFlash("Flash3")
	  3MIS A 5 A_FireCustomMissile("BigRocket",0,1,-5)
	  TNT1 A 0 A_CheckReload
	  TNT1 A 0 A_PlaySound("weapons/brgfire")
	  TNT1 A 0 A_GunFlash("Flash4")
	  3MIS A 4 A_FireCustomMissile("BigRocket",0,1,5)
	  Goto FireEnd
	Level2:
	  TNT1 A 0 A_PlaySound("weapons/brgfire")
	  TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "QuadLevel2")
	  3MIS A 5 A_FireCustomMissile("BigRocket2",0,1,0)
	  TNT1 A 0 A_PlaySound("weapons/brgfire")
	  TNT1 A 0 A_GunFlash("Flash3")
	  3MIS A 5 A_FireCustomMissile("BigRocket2",0,1,-5)
	  TNT1 A 0 A_PlaySound("weapons/brgfire")
	  TNT1 A 0 A_GunFlash("Flash4")
	  3MIS A 4 A_FireCustomMissile("BigRocket2",0,1,5)
 	  Goto FireEnd
	Quad:
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
   	  3MIS A 5 A_FireCustomMissile("ExtremeBigRocket",0,1,0)
	  TNT1 A 0 A_CheckReload
	  TNT1 A 0 A_PlaySound("weapons/brgfire")
	  TNT1 A 0 A_GunFlash("Flash3")
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  3MIS A 5 A_FireCustomMissile("ExtremeBigRocket",0,1,-5)
	  TNT1 A 0 A_CheckReload
	  TNT1 A 0 A_PlaySound("weapons/brgfire")
	  TNT1 A 0 A_GunFlash("Flash4")
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  3MIS A 4 A_FireCustomMissile("ExtremeBigRocket",0,1,5)
	  Goto FireEnd
	QuadLevel2:
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  3MIS A 5 A_FireCustomMissile("ExtremeBigRocket2",0,1,0)
	  TNT1 A 0 A_PlaySound("weapons/brgfire")
	  TNT1 A 0 A_GunFlash("Flash3")
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  3MIS A 5 A_FireCustomMissile("ExtremeBigRocket2",0,1,-5)
	  TNT1 A 0 A_PlaySound("weapons/brgfire")
	  TNT1 A 0 A_GunFlash("Flash4")
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  3MIS A 4 A_FireCustomMissile("ExtremeBigRocket2",0,1,5)
	  Goto FireEnd
	FireEnd:
	  3MSF E 0 A_GunFlash("Flash5")
	  3MIS A 6 A_CheckReload
	  3MIS A 18 A_Playsound("weapons/rcketstrt",CHAN_AUTO)
	  3MIS A 6 A_ReFire
	  Goto Ready
	Flash:
	  3MSF A 6 Bright A_Light1
	  Goto LightDone
	Flash2:
	  3MSF B 6 Bright A_Light2
	  Goto LightDone
	Flash3:
	  3MSF C 6 Bright A_Light1
	  Goto LightDone
	Flash4:
	  3MSF D 6 Bright A_Light2
	  Goto LightDone
	Flash5:
	  3MSF EF 6 Bright A_Light1
	  Goto LightDone
	}
}

// Barrage Launcher's Rocket

ACTOR BigRocket : IDMRocket
{
	Speed 40
	Obituary "%o was barraged by %k's rockets."
	+RANDOMIZE
}

ACTOR ExtremeBigRocket : BigRocket
{
	ProjectileKickBack 600
	+EXTREMEDEATH
	States
	{
	XDeath:
	  TNT1 A 0 A_Playsound("misc/crit",CHAN_AUTO)
	  Goto Death
	}
}

ACTOR BigRocket2 : BigRocket
{
	Radius 23
	Height 15
	Speed 35
	Scale 1.5
	Damage (100 + (30 * random(1,10)))
	ProjectileKickBack 600
	Obituary "%o was barraged by %k's rockets."
	States
	{
	Spawn:
      SHKM A 1 Bright
      Loop
	Death:
	  TNT1 AAAAAAAAAAAAAAAAAAAA 0 A_CustomMissile("IDMMushroom",8,0,random(-180,180),CMF_AIMDIRECTION|CMF_TRACKOWNER,random(0,75))
      MISL B 6 Bright A_Explode(192,192)
      MISL C 5 Bright
	  MISL D 4 Bright
      Stop
	}
}

ACTOR BigMushroom : IDMMushroom
{
	Obituary "%o was barraged by %k's rockets."
}

ACTOR ExtremeBigRocket2 : BigRocket2
{
	+EXTREMEDEATH
	ProjectileKickBack 1200
	States
	{
	XDeath:
	  TNT1 A 0 A_Playsound("misc/crit",CHAN_AUTO)
	  Goto Death
	}
}