// *** MODIFIED BY CHEBMASTER
// I mark most important places modified by me with //***Che -- unless I forget to.

//***Che: incorporating my q2-ish bfg into frankenBD21.5


//***Che: splitting projectiles into a separate file for monsters only -- my supermasterminds need it


ACTOR BIG_FUCKING_GUN : BrutalWeapon
{
	Game Doom
	Height 20
	SpawnID 31
	Weapon.SelectionOrder 101
	Weapon.AmmoUse 0
	Weapon.AmmoGive 0
	Weapon.AmmoType "AmmoCell"
    Inventory.PickupSound "BFGREADY"
	//DamageType Desintegrate
	+FORCEXYBILLBOARD
	+WEAPON.NOAUTOFIRE
	
	//***Che: frakking annoying, limits you to horizontal firing 
	//   - but we have a  Quake II bfg now! (sort of)
	// firing it *over* a crowd's heads is the most devastating!
	+WEAPON.NOAUTOAIM

	Tag "BFG 9000"
    Inventory.PickupMessage "You got the BFG-9000! FUCK YEAH!"
	States
	{
		//***Che disabling player weapons for cutscenes and for the evacuation center
		HoldFire:
			BFGN A 0 offset(50,42) A_JumpIfInventory("Taunting",1,"Taunt")
			BFGN A 0 A_JumpIfInventory("Salute1", 1, "Salute")
			BFGN A 0 A_JumpIfInventory("Salute2", 1, "Salute")
			BFGN A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
			BFGN A 1 offset(50,42) A_WeaponReady(WRF_NOBOB | WRF_NOFIRE)
			BFGN A 0 A_JumpIfInventory("DisablePlayerWeapons", 1, "HoldFire")
			Goto Ready		
	
	

	Ready3:
	Ready:
	Reload:
		TNT1 A 0 A_JumpIfInventory("DisablePlayerWeapons", 1, "HoldFire") //***Che
		BFGN A 1 A_WeaponReady
        BFGN A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        BFGN A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		BFGN A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		BFGN A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		BFGN A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		BFGN A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		Loop
		
	NoAmmo:
		BFGN A 1
		BFGN A 2 A_PlaySound("weapons/empty", 4)
		Goto Ready3
		
	
	CheckSprint:
		BFGN A 1 A_WeaponReady(WRF_NOFIRE)
		BFGN A 0 A_JumpIfInventory("IsStandingStill", 1, "Ready3")
		BFGN A 0 A_JumpIfInventory("IsTacticalClass", 1, "StartSprint")
		Goto Ready
		
	StartSprint:
		BFGN A 1 A_WeaponReady(WRF_NOFIRE)
		BFGN A 0 A_Takeinventory("Zoomed",1)
		BFGN A 0 A_Takeinventory("ADSmode",1)
		BFGN A 0 A_ZoomFactor(1.0)
		BFGN A 0 A_JumpIfInventory("UsedStamina", 40, "StopSprintTired")
		
	Sprinting:	
		BFSP A 0 offset(-9,32) 
		BFGN A 0 offset(-9,32) A_JumpIfInventory("IsStandingStill", 1, "Ready3")
		BFGN A 0 offset(-9,32) A_JumpIfInventory("UsedStamina", 100, "StopSprintTired")
		PLAY A 0 offset(-9,32) ACS_ExecuteAlways(852, 0, 0, 0, 0)//Makes player faster.
		BFGN A 0 offset(-9,32) A_JumpIfInventory("PowerStrength", 1, 2)
		BFGN A 0 offset(-9,32) A_GiveInventory("UsedStamina", 13)
		BFGN A 0 offset(-9,32)
		BFSP A 1 offset(-9,34) A_SetPitch(pitch -0.5)
		BFSP A 1 offset(-6,36) A_SetPitch(pitch -0.5)
		BFSP A 1 offset(-3,38) A_SetPitch(pitch -0.5)
		BFSP A 1 offset(0,38) A_SetPitch(pitch -0.5)
		BFSP A 1 offset(3,36) A_SetPitch(pitch -0.5)
		BFSP A 1 offset(6,34) A_SetPitch(pitch -0.5)
		BFSP A 1 offset(9,32) A_SetPitch(pitch -0.5)
		BFGN A 0 offset(9,32) A_WeaponReady(WRF_NOBOB)
		BFGN A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        BFGN A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        BFGN A 0 A_JumpIfInventory("Reloading",1,"Reload")
		BFGN A 0 offset(-9,32) A_GiveInventory("UsedStamina", 13)
		BFGN A 0 offset(9,33) A_SpawnItemEx("FootStep", 0, 0, 2, 0, 0, -4)
		BFSP A 1 offset(9,34) A_SetPitch(pitch +0.5)
		BFSP A 1 offset(6,36) A_SetPitch(pitch +0.5)
		BFSP A 1 offset(3,38) A_SetPitch(pitch +0.5)
		BFSP A 1 offset(0,38) A_SetPitch(pitch +0.5)
		BFSP A 1 offset(-3,36) A_SetPitch(pitch +0.5)
		BFSP A 1 offset(-6,34) A_SetPitch(pitch +0.5)
		BFSP A 1 offset(-9,32) A_SetPitch(pitch +0.5)
		BFGN A 0 offset(-9,32) A_WeaponReady(WRF_NOBOB)
		BFGN A 0 offset(-9,32) A_JumpIfInventory("IsRunning", 1, "Sprinting")
		Goto StopSprint
		
	StopSprintTired:
		BFGN A 1
		PLAY A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)//Makes player slower.
		BFGN A 0 A_PlaySound("Tired", 2)
		BFGN A 0 A_TakeInventory("UsedStamina", 2)
		BFGN A 5 A_WeaponReady
		BFGN A 0 A_TakeInventory("UsedStamina", 2)
		BFGN A 5 A_WeaponReady
		BFGN A 0 A_TakeInventory("UsedStamina", 2)
		BFGN A 5 A_WeaponReady
		BFGN A 0 A_TakeInventory("UsedStamina", 2)
		BFGN A 5 A_WeaponReady
		BFGN A 0 A_TakeInventory("UsedStamina", 2)
		BFGN A 5 A_WeaponReady
		Goto Ready
	StopSprint:
		BFSP A 1
		BFGN A 0 A_JumpIfInventory("UsedStamina", 60, "StopSprintTired")
		PLAY A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)//Makes player slower.
		Goto Ready
		
	Deselect:
	    TNT1 AAAAAAAAAAAAAAAAAA 0 A_Lower
		BFGN A 0 A_TakeInventory("TossGrenade", 1)
		BFGN A 1 A_Lower
		Loop
		
	Select:
		BFGN A 0 A_Giveinventory("GoSpecial",1)
		BFGN A 0 A_Takeinventory("FistsSelected",1)
		BFGN A 0 A_Takeinventory("sawSelected",1)
		BFGN A 0 A_Takeinventory("ShotgunSelected",1)
		BFGN A 0 A_Takeinventory("SSGSelected",1)
		BFGN A 0 A_Takeinventory("MinigunSelected",1)
		BFGN A 0 A_Takeinventory("PlasmaGunSelected",1)
		BFGN A 0 A_Takeinventory("RocketLauncherSelected",1)
		BFGN A 0 A_Takeinventory("GrenadeLauncherSelected",1)
		BFGN A 0 A_Giveinventory("BFGSelected",1)
		BFGN A 0 A_Takeinventory("BFG10kSelected",1)
		BFGN A 0 A_Takeinventory("RailGunSelected",1)
		BFGN A 0 A_Takeinventory("SubMachineGunSelected",1)
		BFGN A 0 A_Takeinventory("RevenantLauncherSelected",1)

		//***Che
		"----" A 0 A_Takeinventory("UnmakerSelected",1)
		"----" A 0 A_Takeinventory("MG42Selected",1) //***Che
		"----" A 0 A_Takeinventory("AxeSelected",1) //***Che
			
			"----" A 0 A_Takeinventory("DragonslayerSelected",1) //***Che
			"----" A 0 A_Takeinventory("SniperRifleSelected",1)
			"----" A 0 A_Takeinventory("ShotolverSelected",1)
			"----" A 0 A_Takeinventory("Shotolver2Selected",1)
		
		BFGN A 0 A_Takeinventory("LostSoulSelected",1)
		BFGN A 0 A_Takeinventory("FlameCannonSelected",1)
		BFGN A 0 A_Takeinventory("HasBarrel",1)
		BFGN A 0 A_TakeInventory("TossGrenade", 1)
		BFGN A 0 A_GunFlash
		TNT1 A 1 A_Raise
		TNT1 AAAAAAAA 0 A_Raise
		BFGN A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
        BFGN A 0 A_PlaySound("BFGREADY")
		SelectAnimation:
		BFGS ABCDE 1
		Goto Ready

		
	Fire:
		BFGN A 0
		BFGN A 0 A_JumpIfInventory("AmmoCell",50,2)
        Goto NoAmmo	
		BFGN A 0
		TNT1 A 0 A_JumpIfInventory("DisablePlayerWeapons", 1, "HoldFire") //***Che
		BFGN A 0 A_TakeInventory("AmmoCell", 50)
		"----" A 0 A_GiveInventory ("PlayerIsFighting", 150) //***Che encourages the follower NPCs to get da fug out of your line of fire
        BFGN A 0 A_PlaySound("BFGCHARGE")
		BFGC ABCDABCDABCDABCDABCDABCDABCD 1 BRIGHT A_JumpIf(waterlevel > 2, "ShortUnderwater")
			"----" A 0 A_JumpIfInventory("QPowerQuadDamage", 1, 2)
			"----" A 0 A_JumpIf(true, 2)
			"----" A 0 A_PlaySound("quaddamage/echo", CHAN_7)		
        BFGA A 2 BRIGHT A_FireCustomMissile("GreenFlareSpawn",0,0,0,0)
        BFGN A 0 A_PlaySound("BFGFIRE")
		TNT1 AAA 0 A_FireCustomMissile("GreenFlareSpawn",0,0,0,0)
        BFGN A 0 A_Recoil(8)
        
		
        BFGN A 0 BRIGHT A_FireCustomMissile("Alerter", 0, 0, -1, 0)
		BFGN A 0 A_JumpIfInventory("DMgame", 1, 4)
		BFGN A 0 BRIGHT A_FireCustomMissile("BFGBall")
		BFGN A 0
		Goto RecoilFire
		TNT1 AAA 0
		BFGN A 0 BRIGHT A_FireCustomMissile("BFGBallDM")

	RecoilFire:	
		BFGN A 0 A_ZoomFactor(0.9)
		BFGA B 2 BRIGHT
		BFGN A 0 A_ZoomFactor(1.0)
		BFGA CDCB 2 BRIGHT
        BFGN A 1
		BFGN A 8
        BFGN A 0 A_Refire
		Goto Ready3

	ShortUnderwater:
		BFGN AAAAAAAAAAAAAAAAAAAA 1 A_RadiusGive("ElectricShock", 300, RGF_MONSTERS | RGF_PLAYERS | RGF_GIVESELF)
		BFGN A 70
		Goto Ready3		
		
	//Alpha Doom Attack, discontinued.	
	//AltFire:
		BFGN A 1
		BFGN A 0 A_JumpIfInventory("AmmoCell", 50, 5)
		BFGN A 10
		Goto Ready
		TNT1 AAAAAA 0
		TNT1 A 0 A_JumpIfInventory("DisablePlayerWeapons", 1, "HoldFire") //***Che
		BFGN A 0 A_TakeInventory("AmmoCell", 50)
        BFGN A 0 A_PlaySound("BFGCHARGE")
		BFGC ABCDABCDABCDABCD 1 BRIGHT
		BFGC ABCDABCDABCDABCD 1 BRIGHT
        BFGA A 2 BRIGHT A_FireCustomMissile("GreenFlareSpawn",0,0,0,0)
        BFGN A 0 A_PlaySound("BFGFIRE")
		TNT1 AAA 0 A_FireCustomMissile("GreenFlareSpawn",0,0,0,0)
        BFGN A 0 A_Recoil(8)
        //BFGN A 0 A_ZoomFactor(1.3)
        BFGN A 0 BRIGHT A_FireCustomMissile("Alerter", 0, 0, -1, 0)
		BFGN A 0 A_FireCustomMissile("ShakeYourAssDouble", 0, 0, 0, 0)
        BFGA BCBCBCBCBCB 2 BRIGHT A_FireCustomMissile("AlphaBFGBall", random(-6, 6), 0, 0, 0, 0, random(-2, 2))
		BFGA DE 2 BRIGHT
        //BFGN A 0 A_ZoomFactor(1.0)
        BFGN A 1 BRIGHT
		BFGN A 4
        BFGN A 0  A_Refire
		Goto Ready	

	
   
	
	Spawn:
		BFUG A -1
		Stop	
	}
}


//***Che moved to FBD_BFG_Ball.txt