// --------------------------------------------------------------------------
//
// Default base weapon 
//
// --------------------------------------------------------------------------

//Weapon Auxiliar
ACTOR KnifePuff_rat
{
	AttackSound "Knife/Hitwall"
        
        seesound "Knife/Hit"
        
	+NOGRAVITY
	+NOEXTREMEDEATH
	+PUFFONACTORS
DamageType RAT
	States
	{
	Spawn:
    TNT1 A 1 
		Stop
	Melee:
		TNT1 A 1
		Stop
	}
}

//Weapon Auxiliar
ACTOR KnifePuff2_rat
{
	AttackSound "Knife/Hitwall"
        
        seesound "Knife/Stab"
        
	+NOGRAVITY
	+NOEXTREMEDEATH
	+PUFFONACTORS
DamageType RAT
	States
	{
	Spawn:
    TNT1 A 1 
		Stop
	Melee:
		TNT1 A 1
		Stop
	}
}


actor RAT_MELEE : Weapon
{
//	Game Doom

//Basic configuration
  obituary "%k killed %o."
  hitobituary "%k pummeled %o."
  inventory.pickupmessage "Picked up an item!"  
  inventory.pickupsound "misc/WeaponPickup"
  weapon.selectionorder 500
  weapon.kickback 50
  decal NewBulletChip
  AttackSound "DSEMPTY"
 //Weapon.UpSound "weapons/sawup"

//Common flags
  //+NOAUTOFIRE
  +NOALERT
  +DONTBOB
  +IGNORESKILL
	+weapon.CHEATNOTWEAPON
  +WEAPON.NOAUTOAIM
  +INVENTORY.UNDROPPABLE
  
  States
  {
  //Generic states

	Deselect:
				TNT1 A 0 A_StopSound (6)
				TNT1 A 1 A_ZoomFactor(1.0)
		TNT1 A 0 ACS_Execute(782, 0, 0, 0, 0)
                TNT1 AAAAAAAAAAAAAAAAA 0 A_Lower
                TNT1 AAAAAA 1 A_Lower
		Loop

	Select:
				TNT1 A 0 A_Raise
				TNT1 A 1 A_WeaponReady(wrf_nofire)
		Goto ReadyMelee

	Ready:
				TNT1 A 1 A_WeaponReady
		Loop

	Fire:
				TNT1 A 1 A_GunFlash
		Goto Ready






ReadyMelee:
    //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(65, true, 0, "KnifePuff_rat", 96)//A_GunFlash
		W19D BCDEFGHIJKLM 1 A_WeaponReady(WRF_NOFIRE|WRF_DISABLESWITCH)

		W19D N 1 A_WeaponReady(WRF_NOFIRE|WRF_DISABLESWITCH)	TNT1 A 0 A_JumpIfCloser(128, "altfire_max")
		W19D O 1 A_WeaponReady(WRF_NOFIRE|WRF_DISABLESWITCH)	TNT1 A 0 A_JumpIfCloser(128, "altfire_max")
		W19D P 1 A_WeaponReady(WRF_NOFIRE|WRF_DISABLESWITCH)	TNT1 A 0 A_JumpIfCloser(128, "altfire_max")
		W19D Q 1 A_WeaponReady(WRF_NOFIRE|WRF_DISABLESWITCH)	TNT1 A 0 A_JumpIfCloser(128, "altfire_max")
		W19D R 1 A_WeaponReady(WRF_NOFIRE|WRF_DISABLESWITCH)	TNT1 A 0 A_JumpIfCloser(128, "altfire_max")
		W19D S 1 A_WeaponReady(WRF_NOFIRE|WRF_DISABLESWITCH)	TNT1 A 0 A_JumpIfCloser(128, "altfire_max")
		W19D T 1 A_WeaponReady(WRF_NOFIRE|WRF_DISABLESWITCH)	TNT1 A 0 A_JumpIfCloser(128, "altfire_max")
		//W19D U 1 A_WeaponReady(WRF_NOFIRE|WRF_DISABLESWITCH)	TNT1 A 0 A_JumpIfCloser(128, "altfire_max")
		Goto SelectUsed_RAT

	AltFire2:
		W19F A 1 A_CustomPunch(65, true, 0, "KnifePuff_rat", 96)//A_GunFlash
		W19F BCDEFGHIJKLM 1 A_WeaponReady(WRF_NOFIRE|WRF_DISABLESWITCH)

		W19F N 1 A_WeaponReady(WRF_NOFIRE|WRF_DISABLESWITCH)	TNT1 A 0 A_JumpIfCloser(96, "altfire1")
		W19F O 1 A_WeaponReady(WRF_NOFIRE|WRF_DISABLESWITCH)	TNT1 A 0 A_JumpIfCloser(96, "altfire1")
		W19F P 1 A_WeaponReady(WRF_NOFIRE|WRF_DISABLESWITCH)	TNT1 A 0 A_JumpIfCloser(96, "altfire1")
		W19F Q 1 A_WeaponReady(WRF_NOFIRE|WRF_DISABLESWITCH)	TNT1 A 0 A_JumpIfCloser(96, "altfire1")
		W19F R 1 A_WeaponReady(WRF_NOFIRE|WRF_DISABLESWITCH)	TNT1 A 0 A_JumpIfCloser(96, "altfire1")
		W19F S 1 A_WeaponReady(WRF_NOFIRE|WRF_DISABLESWITCH)	TNT1 A 0 A_JumpIfCloser(96, "altfire1")
		W19F T 1 A_WeaponReady(WRF_NOFIRE|WRF_DISABLESWITCH)	TNT1 A 0 A_JumpIfCloser(96, "altfire1")
		//W19F U 1 A_WeaponReady(WRF_NOFIRE|WRF_DISABLESWITCH)	TNT1 A 0 A_JumpIfCloser(96, "altfire1")
		Goto SelectUsed_RAT
	
	
	AltFire_max:
		TNT1 A 0 A_PlayWeaponSound("Knife/Slash")
		W19H ABC 1 A_WeaponReady(WRF_NOFIRE|WRF_DISABLESWITCH)
		W19H D 1 A_CustomPunch(90, true, 0, "KnifePuff2_rat", 128)//, 0.175, 50)//A_GunFlash
		W19H EFGHIJKLMNOPQRSQRSQRS 1 A_WeaponReady(WRF_NOFIRE|WRF_DISABLESWITCH)
		Goto SelectUsed_RAT





	SelectUsed_RAT:
	TNT1 A 2 A_GiveInventory("Rat_Trigger",1)

		TNT1 A 6 //A_PlaySound("HEGRENADE/Ready")
		TNT1 A 3 //A_PlaySound("HEGRENADE/Ready")
	TNT1 A 0 ACS_NamedExecuteAlways("HSPreviousWeapon", 0, 0, 0, 0)
Goto SetWeapon


             SetWeapon:  
        TNT1 A 1 A_WeaponReady(WRF_NOFIRE)//A_SelectWeapon("Knife")
        Goto Ready	




  Flash:
    TNT1 A 5 //
    TNT1 A 0 A_TakeInventory("RAT_MELEE",1)
    stop
  }
}



