Actor Pumping : Inventory {inventory.maxamount 1}

//------------------------------------------------------------------------
//
//  Trench Gun
//
//
//------------------------------------------------------------------------

Actor TRGUN: Weapon

{
	Game Doom
	SpawnID 27
	Weapon.SelectionOrder 1300
	Weapon.AmmoUse1 0
	Weapon.AmmoUse2 0
	Weapon.AmmoGive1 4
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "TGAMMO"
	Weapon.AmmoType2 "TRENCHAMMO"
	Inventory.PickupMessage "Oh lucky bastard,you find the Trench Gun!"
        Inventory.PickupSound "TG/PUMP"
	Obituary "$OB_MPSHOTGUN"
        AttackSound "None"
        +WEAPON.NOALERT
        +WEAPON.NOAUTOAIM
	+WEAPON.NOAUTOFIRE
	States

{
Steady:
Tnt1 a 1
goto ready

Ready:

        TREN CBA 1
        TNT1 A 0 A_PlaySound("TG/PUMP")
        TNT1 AAAAAAAAAAAAAAA 0 A_ZoomFactor(1.0)
        TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
	TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
	TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
	TREN A 1 A_WeaponReady

	Goto Ready+4


	Ready2:
        TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
	TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
	TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
	CDCD A 8 A_WeaponReady
        Loop
	

	Deselect:
	TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
	TNT1 A 0 A_Takeinventory("ADSmode",1)
        tren abc 1
	tnt1 c 0 A_Lower
        Wait
	
	Select:
	TNT1 A 0 A_Raise
        Wait

    Fire:

        TNT1 A 0 A_Takeinventory("Reloading",1)
	TNT1 A 0 A_JumpIfInventory("Zoomed",1,"Fire2")
        TNT1 A 0 A_JumpIfInventory("TRENCHAMMO",1,2)
        Goto Reload
        TNT1 AAAA 0
        TNT1 A 0 A_AlertMonsters
        TNT1 A 0 A_PlaySound("Trengun/fire", 1)
        TNT1 A 0
	TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		
	
	TNT1 AAAAA 0 A_FireCustomMissile("Tracer", random(-5,5), 0, -1, random(-5,5))
       
	TNT1 A 0 A_FireCustomMissile("ShakeYourAssDouble", 0, 0, 0, 0)
	TNT1 A 0 A_Takeinventory("TRENCHAMMO",1)
        TREN FG 1 BRIGHT
	TREN A 0 A_FireBullets (4.0, 4.0, 10, 7, "ShotgunPuff")
tREN A 0 A_SETPITCH(pitch - 5.0)
	TREN A 3
        TNT1 A 0 A_GiveInventory ("Pumping", 1)
tREN A 0 A_SETPITCH(pitch + 5.0)
        TREP AABBCCDDEEFF 1
        TNT1 A 0 A_FireCustomMissile("ShotCaseSpawn",0,0,-4,-4)
        TREN A 0 A_PlaySound("TG/PUMP", 3)
        TREP GGG 1
        TREP GGFFEEDDCCBBAA 1 A_JumpIfInventory("Kicking",1,"DoKick")
        TREN A 0 A_Refire


	Goto Ready+4


Fire2:

        TNT1 A 0 A_Takeinventory("Reloading",1)
        TNT1 A 0 A_JumpIfInventory("TRENCHAMMO",1,2)
        Goto Reload
        TNT1 AAAA 0
        TNT1 A 0 A_AlertMonsters
        TNT1 A 0 A_PlaySound("Trengun/fire", 1)
        TNT1 A 0
	TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
	tren A 0 A_FireBullets (2.3, 2.3, 10, 6, "ShotgunPuff")
        tREN A 0 A_SETPITCH(pitch - 5.0)
	TNT1 AAAAA 0 A_FireCustomMissile("Tracer", random(-5,5), 0, -1, random(-5,5))
	TNT1 A 0 ACS_Execute(281, 0, 0, 0, 0)
	TNT1 A 0 A_Takeinventory("TRENCHAMMO",1)
        CDCD B 2 BRIGHT
	CDCD CDDC 2
        tREN A 0 A_SETPITCH(pitch + 5.0)
        TNT1 A 0 A_ZoomFactor(1.0)
        TRES BA 2	
        TNT1 A 0 A_GiveInventory ("Pumping", 1)
        TREP AABBCCDDEEFF 1
        TNT1 A 0 A_FireCustomMissile("ShotCaseSpawn",0,0,-4,-4)
        TREN A 0 A_PlaySound("TG/PUMP", 3)
        TREP GGG 1
        TREP GGFFEEDDCCBBAA 1 A_JumpIfInventory("Kicking",1,"DoKick")
TNT1 A 0 A_ZoomFactor(1.8)
       TRES AB 2
TNT1 A 0 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_ZoomFactor(1.8)
	TNT1 A 0 A_Giveinventory("ADSmode",1)
        TRES AB 2
        Goto Ready2


        TNT1 AAAAAA 0
        TRES BA 2
	TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
	TNT1 A 0 A_Takeinventory("ADSmode",1)

	Goto Ready+4
	
	Spawn:
		TREN Z -1
		Stop


		    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
		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 SetPlayerProperty(0,0,0)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")

	Goto Ready+4
    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 SetPlayerProperty(0,0,0)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")

	Goto Ready+4
	
	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+4
		
	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+4
    Taunt:
	    TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
        TNT1 A 5
		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 A 2
        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+4
	Salute:
	    TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
	    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+4

//---------------------------------------------------------------------
//
//ZioMcCall'S Reload scripts
//
//----------------------------------------------------------------------

Reload:

	    TREN A 1 A_WeaponReady
	    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("TRENCHAMMO",6,"insertbullets")
            TNT1 A 0 A_JumpIfInventory("TGAMMO",1,3)
            Goto NoAmmo
            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_ZoomFactor(1.0)
	    TNT1 A 0 A_TakeInventory("ADSmode",1)
            TREP ABCDEFG 1
            TREP G 3 A_PlayWeaponSound("Trenchgun/Load")
            TREP G 3
            TRER A 2
            TRER B 2
            TRER C 2
            TRER C 1 A_Refire
            TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
            TNT1 A 0 A_TakeInventory("Reloading", 1)


		InsertBullets:
		TNT1 A 0 A_Giveinventory("TRENCHAMMO",1)
		TNT1 A 0 A_Takeinventory("TGAMMO",1)
                TRER C 0 A_JumpIfInventory("TRENCHAMMO",6,"CRISTIDDIO")
                Goto Reload+22//DIO PORCO,NON VOGLIO VEDE QUEL FRAME DIO OBESO


CRISTIDDIO:
  TNT1 A 0 A_ZoomFactor(1.0)
        TREP AABBCCDDEEFF 1
        TREN A 0 A_PlaySound("TG/PUMP", 3)
        TREP GGG 1
        TREP GGFFEEDDCCBBAA 1 A_JumpIfInventory("Kicking",1,"DoKick")
TREN A 1
GOTO READY+4


}

}

ACTOR TRENCHAMMO : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 6
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 6
}


ACTOR TGAMMO : Ammo 
{
	Inventory.PickupSound "pickups/ammo"
	Inventory.PickupMessage "You pick up four Trench Gun shells"
	Inventory.Amount 4
	Inventory.MaxAmount 60
	Ammo.BackpackAmount 16
	Ammo.BackpackMaxAmount 60
	Mass 10000
        Inventory.Icon "NSHEA0"
	States
	{
	Spawn:
		NSHE A -1
		Loop
	}
}