//------------------------------------------------------------------------
//
//  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 "You take the Winchester TrenchGun"
    Inventory.PickupSound "MP40_TAKE"
Scale 0.5
	Obituary "$OB_MPSHOTGUN"
	Weapon.BobRangeX 0.75
	Weapon.BobRangeY 0.5
	Weapon.BobSpeed 1.5
	Weapon.BobStyle "InverseAlpha" //Denis Belmondo's Bobstyle
        AttackSound "None"
        +WEAPON.NOALERT
        +WEAPON.NOAUTOAIM
	+WEAPON.NOAUTOFIRE
Inventory.Icon "SHOTBACK"
	States

{
Steady:
Tnt1 a 1
goto ready

Ready:

WINS AABB 1 A_PlaySound("WEAPONCHANGE")

        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")
	TNT1 A 0 A_JumpIfInventory("BWgrenade",1,"LaunchGrenade")
	TNT1 A 0 A_JumpIfInventory("Meleeattack",1,"KnifeAttack")
	WING A 1 A_WeaponReady

	Goto Ready+5
	

	Deselect:
	TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
	TNT1 A 0 A_Takeinventory("ADSmode",1)
WINS BBAA 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("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)
        WINF A 1 BRIGHT
	TREN A 0 A_FireBullets (4.0, 4.0, 10, 12, "ShotgunPuff")
tREN A 0 A_SETPITCH(pitch - 5.0)
	WINF BCD 2
        TNT1 A 0 A_GiveInventory ("Pumping", 1)
tREN A 0 A_SETPITCH(pitch + 5.0)
    WINP ABCCDEEF 1
        TNT1 A 0 A_FireCustomMissile("ShotCaseSpawn",0,0,-4,-4)
        TREN A 0 A_PlaySound("TG/PUMP", 3)
        WINP GHI 1
        WINP IHG 1
        WINP FFEEDDCCBB 1 A_JumpIfInventory("Kicking",1,"DoKick")
        TREN A 0 A_Refire


	Goto Ready+4

	
	Spawn:
		WINT a -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:

WING 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",8,"Whereyougo")
TNT1 A 0 A_JumpIfInventory("TGAMMO",1,3)
Goto Whereyougo
TNT1 AAA 0
TNT1 A 0 A_TakeInventory("Zoomed",1)
TNT1 A 0 A_Takeinventory("Reloading",1)
TNT1 A 0 A_ZoomFactor(1.0)
TNT1 A 0 A_TakeInventory("ADSmode",1)
WINP ABCDEFG 1
WINR A 1
WINR B 1
WINR C 1
tnt1 a 0 A_PlayWeaponSound("Trenchgun/Load")
WINR D 1
WINR E 1
WINR F 1
WINR G 1
WINR H 1
WINR I 1 A_Refire
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",8,"NoBug_1")
Goto Reload+22


NoBug_1:
tnt1 a 0 A_ZoomFactor(1.0)
TREN A 0 A_PlaySound("TG/PUMP", 3)
WINP GHI 2
WINP IHG 2
WINP FEDCBA 2
GOTO Ready+4

Whereyougo:
tnt1 a 0 A_ZoomFactor(1.0)
tnt1 a 0 
GOTO Ready+4



LaunchGrenade:	
		TNT1 A 0
		TNT1 A 0 A_Takeinventory("Zoomed",1)
                TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_TakeInventory("LaunchGrenade", 1)
		TNT1 A 0 A_JumpIfInventory("GrenadeAmmo", 1, 1)
		Goto NoGrenade
                NGRA ABCD 2
                TNT1 A 0 A_playSound("Pick/granate")
                 NGRA DD 2
           TNT1 A 0 A_Jump(90,2)
		TNT1 A 0 A_PlaySound("*grenadecall", CHAN_VOICE)
                NGRA DEFG 2
		TNT1 A 0 A_PLaySound ("Launch/granate")
		TNT1 A 0 A_FireCustomMissile("HandGrenade2", random(-3,3), 1, 0, 0, 0, 0)
		GRWF STUVW 2 
		TNT1 A 0 A_TakeInventory("GrenadeAmmo", 1)
		TNT1 A 1 
		TNT1 A 0 A_TakeInventory("LaunchGrenade", 1)
                TNT1 A 0 A_Takeinventory("BWgrenade",1)
		Goto Ready
	
	NoGrenade:
		TNT1 A 0
		TNT1 A 0 A_Print("No Grenades Left!")
TNT1 A 0 A_Takeinventory("BWgrenade",1)
		Goto REady+6


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 TrenchAmmo : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 8
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 8
}

