//// --------------------------------------------------------------------------
//
// MG42. Sprite by Sergeant_mark_IV.Si.Rubo tutto da tutti ahahahaha
//
// --------------------------------------------------------------------------

ACTOR MG42 : Weapon Replaces Chaingun
{
	Weapon.AmmoUse1 0
	Weapon.AmmoGive1 50
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "KARClip"
	Weapon.AmmoType2 "MGAmmo"
	Weapon.BobRangeX 0.75
	Weapon.BobRangeY 0.5
	Weapon.BobSpeed 1.5
	Weapon.BobStyle "InverseAlpha" //Denis Belmondo's Bobstyle
	Obituary "%o was shot down by %k's MG42."
    AttackSound "None"
    Inventory.PickupSound "mp40_take"
	Inventory.Pickupmessage "You got the MG42"
	+WEAPON.WIMPY_WEAPON
    +WEAPON.NOAUTOAIM
    +WEAPON.NOALERT
    +WEAPON.NOAUTOFIRE
Inventory.Icon "MGBACK"
    Scale 0.9
	States
	{
	Steady:
	TNT1 A 1
	Goto Ready
	
	Ready:
        MG42 A 1 A_JumpIfInventory("GoFatality", 1, "Steady")
        MG42 A 0 A_PlaySound("CHGNPKUP")
        MG42 A 0
        MG42 A 0
        MG42 A 0
        MG42 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
	MG42 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
	MG42 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
        MG42 A 0 A_JumpIfInventory("Reloading",1,"Reload")
	MG42 A 4 A_WeaponReady
		Goto Ready+6


    Ready2:
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
	TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
	TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
	MG41 A 2 A_WeaponReady
	Loop


	Deselect:
TNT1 A 0 A_TAKEINVENTORY("BWgrenade",1)
tnt1 a 0 a_takeinventory("taunting",1)
TNT1 A 0 A_TAKEINVENTORY("Meleeattack",1)
	TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
        TNT1 A 0 A_TAKEINVENTORY("Kicking",1)
	TNT1 A 0 A_Takeinventory("ADSmode",1)
        MG42 A 1 A_Lower
	Wait


	Select:
	MG42 A 1 A_Raise
	Wait


    Fire:
        TNT1 A 0 A_JumpIfInventory("MGAmmo",1,2)
        Goto Reload
        TNT1 AAAA 0
	TNT1 A 0 A_JumpIfInventory("Zoomed",1,"Fire2")
        TNT1 A 0 A_PlaySound("MG42")
	mg42 A 1 BRIGHT A_AlertMonsters
        mg42 A 1 A_FireCustomMissile("ShakeYourAss", 0, 0, 0, 0)
	MG42 B 1 BRIGHT BRIGHT A_FireBullets(3, 3, 1, 37, "MachineGunBulletPuff", 1)
	TNT1 A 0 A_SetAngle(random(2, -2) + angle)
	TNT1 A 0 A_SetPitch(-1 + pitch)
                tnt1 A 0 A_Jump(140,2)
		TNT1 A 0 A_PlaySound("*taunt", CHAN_VOICE)
        MG42 A 0 A_FireCustomMissile("MinigunTracer", random(-3,3), 0, -1, random(-3,3))
	TNT1 A 0 A_FireCustomMissile("ShakeYourAss", 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
	TNT1 A 0 A_Takeinventory("MGAmmo",1)
	MG42 C 1 A_FireCustomMissile("50CaseSpawn",5,0,8,-9)
	MG42 A 1 A_Refire

	Goto Ready+6

      Fire2:

        TNT1 A 0 A_PlaySound("MG42")
	mg41 A 1 BRIGHT A_AlertMonsters
        mg41 A 1 A_FireCustomMissile("ShakeYourAss", 0, 0, 0, 0)
	MG41 B 1 BRIGHT A_FireBullets(3, 3, 1, 37, "MachineGunBulletPuff", 1)
	TNT1 A 0 A_SetAngle(random(2, -2) + angle)
	TNT1 A 0 A_SetPitch(-1 + pitch)
                      tnt1 A 0 A_Jump(140,2)
		TNT1 A 0 A_PlaySound("*taunt", CHAN_VOICE)
        MG41 CD 0 A_FireCustomMissile("MinigunTracer", random(-3,3), 0, -1, random(-3,3))
	TNT1 A 0 A_FireCustomMissile("ShakeYourAss", 0, 0, 0, 0)
	TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
	TNT1 A 0 A_Takeinventory("MGAmmo",1)
	MG41 DC 1 A_FireCustomMissile("50CaseSpawn",5,0,8,-9)
	MG41 A 1 A_Refire

	Goto Ready2


    AltFire:

        TNT1 A 0
	TNT1 A 0 A_JumpIfInventory("Zoomed",1,8)
	TNT1 A 0 A_Giveinventory("Zoomed",1)
	TNT1 A 0 A_Giveinventory("GoSpecial",1)
	TNT1 A 0 A_ZoomFactor(2.3)
	TNT1 A 0 A_Giveinventory("ADSmode",1)
        MGIR ABC 2

        Goto Ready2
        TNT1 AAAAAA 0
           MGIR CBC 2
	TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
	TNT1 A 0 A_Takeinventory("ADSmode",1)
        Goto Ready+6


	NoAmmo:
	MG42 A 1 A_PlaySound("weapons/empty")
	TNT1 A 0 A_Takeinventory("Zoomed",1)
    TNT1 A 0 A_ZoomFactor(1.0)
	TNT1 A 0 A_Takeinventory("ADSmode",1)
	Goto Ready+6
	
       Reload:

	MG42 A 4 A_WeaponReady
	TNT1 A 0 A_ZoomFactor(1.0)
	TNT1 A 0 A_Takeinventory("Reloading",1)
	TNT1 A 0 A_Takeinventory("ADSmode",1)
	TNT1 A 0 A_Takeinventory("Zoomed",1)
	TNT1 A 0 A_JumpIfInventory("MGAmmo",50,"InsertBullets")
        TNT1 A 0 A_JumpIfInventory("KARClip",1,3)
        Goto NoAmmo
                tnt1 A 0 A_Jump(50,2)
		TNT1 A 0 A_PlaySound("*taunt", CHAN_VOICE)
        TNT1 AAA 0
	TNT1 A 0 A_Takeinventory("Zoomed",1)
	TNT1 A 0 A_GiveInventory ("Pumping", 1)
	TNT1 A 0 A_Takeinventory("Reloading",1)
        tnt1 a 0 A_PlaySound("MG42_OUT")
        MG4R ABCDEF 2  
        MG4R F 1 
        MG4R FFFFFFF 2  
MG4R ED 2  
        tnt1 a 0 A_PlaySound("MG42_in")
MG4R CBA 2  
        tnt1 a 0 A_PlaySound("MG42_click")
        MGFR AABBCC 2 
	
	InsertBullets:
	TNT1 AAAA 0
	TNT1 A 0 A_JumpIfInventory("MGAMMO",50,"ORCODIO")
	TNT1 A 0 A_JumpIfInventory("KARClip",1,3)
	Goto Ready+6
        TNT1 AAAAAA 0
	TNT1 A 0 A_Giveinventory("MGAmmo",1)
	TNT1 A 0 A_Takeinventory("KARClip",1)
	Goto InsertBullets
		
	TNT1 AAAAAAAAAA 0
	TNT1 A 0 A_Takeinventory("Reloading",1)
        Goto Ready+6
	TNT1 AAAA 0
	TNT1 A 0 A_Takeinventory("Reloading",1)
        Goto Ready+6

 	Spawn:
		MGUN A -1
		Stop

ORCODIO:

		MG42 A 4 A_WeaponReady
		Goto Ready+6

 DoKick:
	    TNT1 A 0
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		NULL A 0 A_JumpIf (momZ > 0, "AirKick")
		NULL A 0 A_JumpIf (momZ < 0, "AirKick")
		
        TNT1 A 0 A_jumpifinventory("PowerStrength",1,"BerserkerKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		KICK BCD 1
		//TNT1 A 0 A_Custompunch(4,0,1,"KickPuff")
		RIFF A 0 A_FireCustomMissile("KickAttack", 0, 0, 0, -7)
        KICK H 4
		KICK A 0 A_Takeinventory("Kicking",1)
		KICK IGFEDCBA 1
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		TNT1 A 0 SetPlayerProperty(0,0,0)
		Goto Ready+6
    BerserkerKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		KICK ABCDEFG 1
        RIFF A 0 A_FireCustomMissile("SuperKickAttack", 0, 0, 0, -7)
        KICK H 3
		KICK A 0 A_Takeinventory("Kicking",1)
		KICK IGFEDCBA 1
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		TNT1 A 0 SetPlayerProperty(0,0,0)
		Goto Ready+6
	
	AirKick:
	    TNT1 A 0 A_jumpifinventory("PowerStrength",1,"SuperAirKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 A_Recoil (-6)
		KICK JKLMN 1
        RIFF A 0 A_FireCustomMissile("AirKickAttack", 0, 0, 0, -31)
        KICK O 3
		KICK A 0 A_Takeinventory("Kicking",1)
		KICK PQRST 2
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto Ready+6
		
	SuperAirKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 A_Recoil (-6)
		KICK JKLMN 1
        RIFF A 0 A_FireCustomMissile("SuperAirKickAttack", 0, 0, 0, -31)
        KICK O 3
		KICK A 0 A_Takeinventory("Kicking",1)
		KICK PQRST 2
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto Ready+6
    Taunt:
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
        TNT1 A 5
		FUCK A 2
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", 0, 0, -1, 0)
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", -9, 0, -1, 0)
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", 9, 0, -1, 0)
        FUCK B 2 A_PlaySound("FUCK", 1)
        FUCK C 2 A_AlertMonsters
		FUCK D 15 A_Takeinventory("Taunting",1)
        FUCK CBA 5
        TNT1 A 5
		Goto Ready
	Salute:
	    TNT1 A 0 SetPlayerProperty(0,1,0)
		TNT1 A 0 A_ALertMonsters
		SALU ABCDEDCDEDCDEDCBA 4
		TNT1 A 0 A_TakeInventory("Salute1",1)
		TNT1 A 0 A_TakeInventory("Salute2",1)
		TNT1 A 0 SetPlayerProperty(0,0,0)
		Goto Ready


KnifeAttack:
                TNT1 A 0 A_ZoomFactor(1.0)
           tnt1 A 0 A_Jump(90,2)
		TNT1 A 0 A_PlaySound("*taunt", CHAN_VOICE)
		KNIF ABCDE 1
        KNIF F 1 A_PlaySound("weapons/wknife")
		KNIF F 0 A_Custompunch(16,0,1,"KnifePuff")
                KNIF GHI 1 
TNT1 A 0 A_Takeinventory("Meleeattack",1)
		GOTO READY+6


	}
}



ACTOR MGAmmo : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 50
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 50
}