Actor hudbarrels : AMMO
{
inventory.maxamount 2
Inventory.Icon "ISSGA0"
}

Actor leftbarrel : AMMO
{
inventory.maxamount 1
}

Actor rightbarrel : AMMO
{
inventory.maxamount 1
}

Actor SSGRELOAD : INVENTORY
{
inventory.maxamount 1
}

Actor martillo : inventory
{
inventory.maxamount 2
}

Actor SSG : FIST1 
{
	Game Doom
	Weapon.SelectionOrder 1802
	Weapon.AmmoUse1 0
	Weapon.AmmoUse2 0
	Weapon.AmmoGive 0
	Weapon.AmmoType1 "NewShell"
	Weapon.AmmoType2 "hudbarrels"
	Weapon.SlotNumber 3
	Scale 1.1
	Obituary "$OB_MPPISTOL"
	Decal BulletChip
	Inventory.Pickupmessage "Shotgun"
	+WEAPON.NOAUTOFIRE
	+WEAPON.NOALERT
	Tag "Escopeta de doble barril"
	States
	{
Select:
		tnt1 a 0 a_zoomfactor(1)
		tnt1 a 0 A_TakeInventory("ZOOMED",1)
		tnt1 a 0 a_takeinventory("PUNCHIN",1)
		tnt1 a 0 a_takeinventory("lanzalaputog",1)
		tnt1 a 0 a_zoomfactor(1)
		SSGR A 1 A_Raise
	loop
		
Deselect:
		tnt1 a 0 a_zoomfactor(1)
		TNT1 A 0 A_TakeInventory("Recoil",3)
		TNT1 A 0 A_takeINVENTORY("SSGRELOAD",1)
		SSGR A 1 A_Lower
	LOOP
		
ALASPINASWACHO:
		SSGR a 1 offset(-2,34)
		SSGR a 1 offset(-10,42)
		SSGR a 1 offset(-21,54)
		SSGR a 1 offset(-31,66)
		SSGR a 1 offset(-41,82)
		tnt1 a 2
		tmt1 a 0 offset(2,32)
		tnt1 a 0 a_takeinventory("PUNCHIN",1)
		tnt1 a 0 a_gunflash("Puchin")
		tnt1 aaaa 5
		SSGR a 1 offset(-10,66)
		SSGR a 1 offset(-8,69)
		SSGR a 1 offset(-6,48)
		SSGR a 1 offset(-4,42)
		SSGR a 1 offset(-2,36)
		SSGR a 1 offset(0,34)
		SSGR a 1 offset(0,33)
		SSGR a 1 offset(0,32)
		tnt1 a 0 a_takeinventory("PUNCHIN",1)
	goto ready

grenadetr:
		tnt1 a 0 a_takeinventory("lanzalaputog",1)
		TNT1 A 0 A_JumpIfInventory("GrenadeItem",1,1)
	Goto Ready
		TNT1 A 0 A_TakeInventory("GrenadeItem",1)
		SSGR a 1 offset(0,33)
		SSGR a 1 offset(0,34)
		SSGR a 1 offset(0,36)
		SSGR a 1 offset(0,42)
		SSGR a 1 offset(0,48)
		SSGR a 1 offset(0,54)
		SSGR a 1 offset(0,60)
		SSGR a 1 offset(0,66)
		SSGR a 1 offset(0,72)
		SSGR a 1 offset(0,82)
		tnt1 a 4
		tnt1 a 0 a_takeinventory("lanzalaputog",1)
		tmt1 a 0 offset(0,32)
		tnt1 a 0 a_gunflash("thorwgrenadewacho")
		tnt1 aaaaaa 8
		SSGR a 1 offset(0,66)
		SSGR a 1 offset(0,69)
		SSGR a 1 offset(0,48)
		SSGR a 1 offset(0,42)
		SSGR a 1 offset(0,36)
		SSGR a 1 offset(0,34)
		SSGR a 1 offset(0,33)
		SSGR a 1 offset(0,32)
		tnt1 a 0 a_takeinventory("lanzalaputog",1)
	goto ready

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////CHEQUEOS////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


Ready:
CheckBarrels:
		XXXX A 0 A_JumpIfInventory("hudbarrels",2,"Check2")
		XXXX A 0 A_JumpIfInventory("leftbarrel",1,"CheckLCannon")
		XXXX A 0 A_JumpIfInventory("rightbarrel",1,"CheckRCannon")
	Goto CheckE
		
Check2:
		mmmm A 0 A_JumpIfInventory("martillo",2,"Ready2R")
		mmmm A 0 A_JumpIfInventory("martillo",1,"Ready2C")
	Goto Ready2L
		
CheckLCannon:
		mmmm A 0 A_JumpIfInventory("martillo",2,"ReadyLCR")
		mmmm A 0 A_JumpIfInventory("martillo",1,"ReadyLCC")
	Goto ReadyLCL	
	
CheckRCannon:
		mmmm A 0 A_JumpIfInventory("martillo",2,"ReadyRCR")
		mmmm A 0 A_JumpIfInventory("martillo",1,"ReadyRCC")
		Goto ReadyRCL
		
CheckE:
		mmmm A 0 A_JumpIfInventory("martillo",2,"ReadyECR")
		mmmm A 0 A_JumpIfInventory("martillo",1,"ReadyECC")
	Goto ReadyECL		
		
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////READYS//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Ready2R:
		tnt1 a 0 ACS_NamedExecuteAlways("SetPlayerSpeed",0,45)
		tnt1 a 0 a_jumpifinventory("lanzalaputog",1,"grenadetr")
		tnt1 a 0 A_JumpIfInventory("PUNCHIN",1,"ALASPINASWACHO")
		SSGR C 1 A_WeaponReady(WRF_ALLOWZOOM|WRF_ALLOWRELOAD)
	Loop
			
Ready2C:
		tnt1 a 0 ACS_NamedExecuteAlways("SetPlayerSpeed",0,45)
		tnt1 a 0 a_jumpifinventory("lanzalaputog",1,"grenadetr")
		tnt1 a 0 A_JumpIfInventory("PUNCHIN",1,"ALASPINASWACHO")
		SSGR A 1 A_WeaponReady(WRF_ALLOWZOOM|WRF_ALLOWRELOAD)
	Loop
		
Ready2L:
		tnt1 a 0 ACS_NamedExecuteAlways("SetPlayerSpeed",0,45)
		tnt1 a 0 a_jumpifinventory("lanzalaputog",1,"grenadetr")
		tnt1 a 0 A_JumpIfInventory("PUNCHIN",1,"ALASPINASWACHO")
		SSGR B 1 A_WeaponReady(WRF_ALLOWZOOM|WRF_ALLOWRELOAD)
	Loop
	
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

ReadyLCR:
		tnt1 a 0 ACS_NamedExecuteAlways("SetPlayerSpeed",0,45)
		tnt1 a 0 a_jumpifinventory("lanzalaputog",1,"grenadetr")
		tnt1 a 0 A_JumpIfInventory("PUNCHIN",1,"ALASPINASWACHO")
		SSGR L 1 A_WeaponReady(WRF_ALLOWZOOM|WRF_ALLOWRELOAD)
	Loop
	
ReadyLCC:
		tnt1 a 0 ACS_NamedExecuteAlways("SetPlayerSpeed",0,45)
		tnt1 a 0 a_jumpifinventory("lanzalaputog",1,"grenadetr")
		tnt1 a 0 A_JumpIfInventory("PUNCHIN",1,"ALASPINASWACHO")
		SSGR J 1 A_WeaponReady(WRF_ALLOWZOOM|WRF_ALLOWRELOAD)
	Loop
		
ReadyLCL:
		tnt1 a 0 ACS_NamedExecuteAlways("SetPlayerSpeed",0,45)
		tnt1 a 0 a_jumpifinventory("lanzalaputog",1,"grenadetr")
		tnt1 a 0 A_JumpIfInventory("PUNCHIN",1,"ALASPINASWACHO")
		SSGR K 1 A_WeaponReady(WRF_ALLOWZOOM|WRF_ALLOWRELOAD)
	Loop

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

ReadyRCR:
		tnt1 a 0 ACS_NamedExecuteAlways("SetPlayerSpeed",0,45)
		tnt1 a 0 a_jumpifinventory("lanzalaputog",1,"grenadetr")
		tnt1 a 0 A_JumpIfInventory("PUNCHIN",1,"ALASPINASWACHO")
		SSGR F 1 A_WeaponReady(WRF_ALLOWZOOM|WRF_ALLOWRELOAD)
	Loop
	
ReadyRCC:
		tnt1 a 0 ACS_NamedExecuteAlways("SetPlayerSpeed",0,45)
		tnt1 a 0 a_jumpifinventory("lanzalaputog",1,"grenadetr")
		tnt1 a 0 A_JumpIfInventory("PUNCHIN",1,"ALASPINASWACHO")
		SSGR D 1 A_WeaponReady(WRF_ALLOWZOOM|WRF_ALLOWRELOAD)
	Loop
	
ReadyRCL:
		tnt1 a 0 ACS_NamedExecuteAlways("SetPlayerSpeed",0,45)
		tnt1 a 0 a_jumpifinventory("lanzalaputog",1,"grenadetr")
		tnt1 a 0 A_JumpIfInventory("PUNCHIN",1,"ALASPINASWACHO")
		SSGR E 1 A_WeaponReady(WRF_ALLOWZOOM|WRF_ALLOWRELOAD)
	Loop
	
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

ReadyECR:
		tnt1 a 0 ACS_NamedExecuteAlways("SetPlayerSpeed",0,45)
		tnt1 a 0 a_jumpifinventory("lanzalaputog",1,"grenadetr")
		tnt1 a 0 A_JumpIfInventory("PUNCHIN",1,"ALASPINASWACHO")
		SSGR I 1 A_WeaponReady(WRF_ALLOWZOOM|WRF_ALLOWRELOAD)
	Loop
		
ReadyECC:
		tnt1 a 0 ACS_NamedExecuteAlways("SetPlayerSpeed",0,45)
		tnt1 a 0 a_jumpifinventory("lanzalaputog",1,"grenadetr")
		tnt1 a 0 A_JumpIfInventory("PUNCHIN",1,"ALASPINASWACHO")
		SSGR G 1 A_WeaponReady(WRF_ALLOWZOOM|WRF_ALLOWRELOAD)
	Loop
		
ReadyECL:
		tnt1 a 0 ACS_NamedExecuteAlways("SetPlayerSpeed",0,45)
		tnt1 a 0 a_jumpifinventory("lanzalaputog",1,"grenadetr")
		tnt1 a 0 A_JumpIfInventory("PUNCHIN",1,"ALASPINASWACHO")
		SSGR H 1 A_WeaponReady(WRF_ALLOWZOOM|WRF_ALLOWRELOAD)
	Loop
		
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////LOQUEVENGA//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

AltFire:
tnt1 a 0 A_playsound("SGPUMP2",5,1.0)
TNT1 A 0 A_GiveInventory("martillo",1)
Goto Ready

Zoom:
tnt1 a 0 A_playsound("SGPUMP2",5,1.0)
TNT1 A 0 A_TakeInventory("martillo",1)
Goto Ready

FIRE:
TNT1 A 0 
Goto Ready

















R50:
TNT1 A 1 A_SetPitch(Pitch+1.0)
TNT1 A 1 A_SetPitch(Pitch+1.0)
TNT1 A 1 A_SetPitch(Pitch+0.5)
TNT1 A 1 A_SetPitch(Pitch+0.5)
R20:
TNT1 A 1 A_SetPitch(Pitch+0.2)
TNT1 A 1 A_SetPitch(Pitch+0.1)
R17:
TNT1 A 1 A_SetPitch(Pitch+0.1)
TNT1 A 1 A_SetPitch(Pitch+0.1)
TNT1 A 1 A_SetPitch(Pitch+0.1)
R14:
TNT1 A 1 A_SetPitch(Pitch+0.1)
R13:
TNT1 A 1 A_SetPitch(Pitch+0.1)
R12:
TNT1 A 1 A_SetPitch(Pitch+0.1)
TNT1 A 1 A_SetPitch(Pitch+0.1)
R10:
TNT1 A 1 A_SetPitch(Pitch+0.1)
TNT1 A 1 A_SetPitch(Pitch+0.1)
TNT1 A 1 A_SetPitch(Pitch+0.1)
TNT1 A 1 A_SetPitch(Pitch+0.1)
R06:
TNT1 A 1 A_SetPitch(Pitch+0.1)
R05:
TNT1 A 1 A_SetPitch(Pitch+0.1)
TNT1 A 1 A_SetPitch(Pitch+0.05)
TNT1 A 1 A_SetPitch(Pitch+0.05)
TNT1 A 1 A_SetPitch(Pitch+0.05)
TNT1 A 1 A_SetPitch(Pitch+0.05)
R02:
TNT1 A 1 A_SetPitch(Pitch+0.03)
TNT1 A 1 A_SetPitch(Pitch+0.03)
TNT1 A 1 A_SetPitch(Pitch+0.03)
TNT1 A 1 A_SetPitch(Pitch+0.02)
TNT1 A 1 A_SetPitch(Pitch+0.03)
TNT1 A 1 A_SetPitch(Pitch+0.02)
TNT1 A 1 A_SetPitch(Pitch+0.02)
TNT1 A 1 A_SetPitch(Pitch+0.02)
Stop

 	Spawn:
	ISSG A -1
	Stop
	}
}


