//-------Concussion Rifle is analog BFG in doom-----//
Actor KyleConcussionRifle : Weapon 30005
{     
	 Weapon.AmmoType1 "PowerCells"
	 Weapon.AmmoUse1 4
	 Weapon.AmmoGive1 100
	 Inventory.PickupMessage "Concussion Rifle"
     Inventory.PickupSound "ItemPickup"
	 Weapon.BobStyle InverseSmooth
	 Weapon.BobSpeed 0.9	 
	 +AMMO_OPTIONAL
	 States
	 {
	 Ready:
	    DF08 A 1 A_WeaponReady
		Loop
	//-------Spesial Select and Deselect animations, using offset------//	
	 Select:
	    NULL A 0 A_PlaySound("WeaponSelect")
		DF08 A 1 offset(27, 68)
		DF08 A 1 offset(21, 60)
		DF08 A 1 offset(15, 52)
		DF08 A 1 offset(9, 44)
		DF08 A 1 offset(3, 36)	
		DF08 AAAAAAAAAAAAAAAAAAAA 0 A_Raise
	    DF08 A 1 A_Raise
	    Goto Select+5
	 Deselect:
	    DF08 A 1 offset(3, 36)
		DF08 A 1 offset(9, 44)
		DF08 A 1 offset(15, 52)
		DF08 A 1 offset(21, 60)
		DF08 A 1 offset(27, 68)
		TNT1 A 0 A_TakeInventory("UseAmmo", 999)
		DF08 AAAAAAAAAAAAAAAAAAA 0 A_Lower
	    DF08 A 1 A_Lower
		Goto Deselect+6
	//-------------------------------------------------------------------//	
	//----------------Standart Fire-------------------//	
	 Fire:
	    TNT1 A 0 A_JumpIfInventory("PowerWeaponsSuper", 1, "FastFire")
	    NULL A 0 A_JumpIfNoAmmo("OutOfAmmo")
	    NULL A 0 A_PlaySound("ConcussionStart", 5)
		NULL A 0 A_PlaySound("ConcussionFire", 6)
	    DF08 B 1 Bright A_FireCustomMissile("ConcussionRifleProjectile")
		DF08 B 11 Bright
		DF08 C 3 Bright 
		DF08 A 14
	    Goto Ready
	//-------------Weapon Superchange!---------//
	FastFire:
	    TNT1 A 0 A_JumpIfInventory("UseAmmo", 1, "FastFireUseAmmo")
	    NULL A 0 A_JumpIfNoAmmo("OutOfAmmo")
	    NULL A 0 A_PlaySound("ConcussionStart", 5)
		NULL A 0 A_PlaySound("ConcussionFire", 6)
	    DF08 B 1 Bright A_FireCustomMissile("ConcussionRifleProjectile",0,False)
		TNT1 A 0 A_GiveInventory("UseAmmo", 1)
		DF08 B 6 Bright
		DF08 C 3 Bright 
		DF08 A 5
	    Goto Ready
		
	FastFireUseAmmo:
	    NULL A 0 A_JumpIfNoAmmo("OutOfAmmo")
	    NULL A 0 A_PlaySound("ConcussionStart", 5)
		NULL A 0 A_PlaySound("ConcussionFire", 6)
	    DF08 B 1 Bright A_FireCustomMissile("ConcussionRifleProjectile",0,True)
		TNT1 A 0 A_TakeInventory("UseAmmo", 1)
		DF08 B 6 Bright
		DF08 C 3 Bright 
		DF08 A 5
	    Goto Ready	
	//--------------------------------------------------//	
	//----------Out of ammo--------------//	
	 OutOfAmmo:
	    DF08 A 2 A_WeaponReady
		NULL A 0 A_PlaySound("ConcussionOut")
		Goto Ready
	//-------------------------------------//
	//--------I know what you talk) It's weapon spawn on map)-----//
	 Spawn:
	    DFW5 A -1
		Stop
	//-------------------------------------------------------------//	
	    }
}

//------Fast Projectile for Weapon. It using BFGSpay----//
Actor ConcussionRifleProjectile : FastProjectile
{
	Radius 4
	Height 4
	Speed 100
	Damage (25)
	Projectile
	+NOGRAVITY
	States
	{
	Spawn: 
		NULL A 1 Bright
		Loop
	Death:
		NULL A 0 A_BFGSpray("ConcussionRifleExtra", 10, 3)
		TNT1 A 0 A_SpawnItemEx("ConcussionRifleExplode", 0, 0, floorz-z, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
		Stop
	XDeath:
		NULL A 0 A_BFGSpray("ConcussionRifleExtra", 10, 3)
		TNT1 A 0 A_SpawnItemEx("ConcussionRifleExplode", 0, 0, floorz-z, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
		Stop	
	}
}
//----------------------------------------------------------// 


//----------It explode for projectile--------------------//
Actor ConcussionRifleExplode
{
    +NOBLOCKMAP
	-NOGRAVITY
	+FLOORHUGGER
	States
	{
	Spawn:
	    NULL A 0
		NULL A 0 A_PlaySound("MineExplode")
		NULL A 0 A_BFGSpray("ConcussionRifleExtra", 10, 3)
		NULL A 0 A_Explode(30, 200)
		DFP7 ABCDEFGH 3 Bright
		Stop
	}
}
//-----------------------------------------------------------//

     		
//-----------------BFGSpay)-----------------------------//	
Actor ConcussionRifleExtra
{
    +NOBLOCKMAP
	-NOGRAVITY
	+FLOORHUGGER
	States
	{
	Spawn:
	    NULL A 0
		NULL A 0 A_PlaySound("MineExplode")
		DFP7 ABCDEFGH 3 Bright
		Stop
	}
}	
//-----------------------------------------------------------//	
	