// --------------------------------------------------------------------------
//
// AK47 (Demo weapon "Appears on weapons training")
//
// --------------------------------------------------------------------------

ACTOR "AK47_RAT" : AK47 //5010
{
	+POWERED_UP 
	Weapon.SisterWeapon Ak47

//+AMMO_OPTIONAL

	Weapon.SelectionOrder 1900

  weapon.ammotype1 "762mmAmmo"
  weapon.ammouse1 1
  weapon.ammogive1 30
	obituary "%k killed %o with AK-47."
	+WEAPON.WIMPY_WEAPON
	Inventory.Pickupmessage "Picked up an AK-47."
	Tag "AK-47"
	Weapon.UpSound "AK47/Ready"
	//AttackSound "AK47/Fire"
	Scale 0.18
	
	States
	{
	AltFire:
	TNT1 A 0 ACS_Execute(781, 0, 0, 0, 0)
	Goto Ready

	/*
	AltFire:
    //TNT1 A 0 A_JumpIfCloser(64, "altfire_max")
	
	TNT1 A 1 A_PlayWeaponSound("Knife/Slash")	TNT1 A 0 A_JUMP(256,1,"ALTFIRE2")	TNT1 A 1	
	Goto AltFire1

	AltFire1:
		W19D A 1 A_CustomPunch(9, 0, 0, "KnifePuff", 96)//A_GunFlash
		W19D BCDEFGHIJKLM 1 A_WeaponReady(WRF_NOFIRE)

		W19D N 1 A_WeaponReady(WRF_NOFIRE)	TNT1 A 0 A_JumpIfCloser(72, "altfire_max")
		W19D O 1 A_WeaponReady(WRF_NOFIRE)	TNT1 A 0 A_JumpIfCloser(72, "altfire_max")
		W19D P 1 A_WeaponReady(WRF_NOFIRE)	TNT1 A 0 A_JumpIfCloser(72, "altfire_max")
		W19D Q 1 A_WeaponReady(WRF_NOFIRE)	TNT1 A 0 A_JumpIfCloser(72, "altfire_max")
		W19D R 1 A_WeaponReady(WRF_NOFIRE)	TNT1 A 0 A_JumpIfCloser(72, "altfire_max")
		W19D S 1 A_WeaponReady(WRF_NOFIRE)	TNT1 A 0 A_JumpIfCloser(72, "altfire_max")
		W19D T 1 A_WeaponReady(WRF_NOFIRE)	TNT1 A 0 A_JumpIfCloser(72, "altfire_max")
		W19D U 1 A_WeaponReady(WRF_NOFIRE)	TNT1 A 0 A_JumpIfCloser(72, "altfire_max")
		Goto Select_RAT

	AltFire2:
		W19F A 1 A_CustomPunch(9, 0, 0, "KnifePuff", 96)//A_GunFlash
		W19F BCDEFGHIJKLM 1 A_WeaponReady(WRF_NOFIRE)

		W19F N 1 A_WeaponReady(WRF_NOFIRE)	TNT1 A 0 A_JumpIfCloser(72, "altfire1")
		W19F O 1 A_WeaponReady(WRF_NOFIRE)	TNT1 A 0 A_JumpIfCloser(72, "altfire1")
		W19F P 1 A_WeaponReady(WRF_NOFIRE)	TNT1 A 0 A_JumpIfCloser(72, "altfire1")
		W19F Q 1 A_WeaponReady(WRF_NOFIRE)	TNT1 A 0 A_JumpIfCloser(72, "altfire1")
		W19F R 1 A_WeaponReady(WRF_NOFIRE)	TNT1 A 0 A_JumpIfCloser(72, "altfire1")
		W19F S 1 A_WeaponReady(WRF_NOFIRE)	TNT1 A 0 A_JumpIfCloser(72, "altfire1")
		W19F T 1 A_WeaponReady(WRF_NOFIRE)	TNT1 A 0 A_JumpIfCloser(72, "altfire1")
		W19F U 1 A_WeaponReady(WRF_NOFIRE)	TNT1 A 0 A_JumpIfCloser(72, "altfire1")
		Goto Select_RAT
	
	
	AltFire_max:
		TNT1 A 0 A_PlayWeaponSound("Knife/Slash")
		W19H ABC 1 A_WeaponReady(WRF_NOFIRE)
		W19H D 1 A_CustomPunch(32, 0, 0, "KnifePuff2", 128)//, 0.175, 50)//A_GunFlash
		W19H EFGHIJKLMNOPQRSQRSQRS 1 A_WeaponReady(WRF_NOFIRE)
		Goto Select_RAT



	Select_RAT:
		TNT1 A 0 A_PlaySound ("Ak47/Ready")
		W01A BCDEFGHIJKLMN 1 A_WEAPONREADY(WRF_NOFIRE)
		W01A OPQRSTUVWXYZ 1 A_WEAPONREADY
		W01B ABCDEFGHIJK 1 A_WEAPONREADY
		Goto Ready		
		*/
		
			
	Fire:
		W01D Z 0 A_JumpIfNoAmmo("Ready")

		W01D A 1 A_GunFlash
		W01D B 1 A_WEAPONREADY(WRF_NOFIRE)
		W01D C 1 A_WEAPONREADY(WRF_NOFIRE)
		W01D D 1 A_WEAPONREADY(WRF_NOFIRE)
		TNT1 A 0 A_Refire
		W01D EFGHIJKLMNOPQRSTUVWXYZ 1 A_WeaponReady
		Goto Ready

	}
}