defineprojectile SHOTAMMO PROJ_WORKSLIKE 4097
defineprojectile SHOTAMMO PROJ_SPAWNS -1
defineprojectile SHOTAMMO PROJ_DECAL -1
defineprojectile SHOTAMMO PROJ_EXTRA 4
defineprojectile SHOTAMMO PROJ_XREPEAT 3
defineprojectile SHOTAMMO PROJ_YREPEAT 3

defineprojectile NEWSHSHELL PROJ_WORKSLIKE 6278
defineprojectile NEWSHSHELL PROJ_EXTRA 0
defineprojectile NEWSHSHELL PROJ_HITRADIUS 0
defineprojectile NEWSHSHELL PROJ_VEL 24
defineprojectile NEWSHSHELL PROJ_SPAWNS FLOORSHSHEEL
defineprojectile NEWSHSHELL PROJ_DROP -256
defineprojectile NEWSHSHELL PROJ_BOUNCES 2
defineprojectile NEWSHSHELL PROJ_BSOUND SHTSHL4
defineprojectile NEWSHSHELL PROJ_CLIPDIST 16
defineprojectile NEWSHSHELL PROJ_XREPEAT 4
defineprojectile NEWSHSHELL PROJ_YREPEAT 4
actor NEWSHSHELL 0 FRAME_FRAME1 enda

gamevar WEAPON2_SHOOTS SHOTAMMO 1
gamevar WEAPON2_SHOTSPERBURST 16 1
gamevar WEAPON2_CLIP 2 1
gamevar WEAPON2_RELOAD 30 1
gamevar WEAPON2_SPAWN -1 0
gamevar WEAPON2_FIRESOUND SHOTFIRE 1
gamevar WEAPON2_SOUND2SOUND SHOTCOCK 1

state qav_initframes2
setvarvar WEAPON2_TOTALTIME qav_maxframes
mulvarvar WEAPON2_TOTALTIME qav_tpf
divvarvar WEAPON2_TOTALTIME 4
setvarvar qav_frame player[THISACTOR].kickback_pic
mulvarvar qav_frame 4
divvarvar qav_frame qav_tpf
ends

state qav_initfralt2
setvarvar WEAPON2_TOTALTIME qav_maxframes
mulvarvar WEAPON2_TOTALTIME qav_tpf
divvarvar WEAPON2_TOTALTIME 4
setvarvar qav_frame akimboshotgunalt
mulvarvar qav_frame 4
divvarvar qav_frame qav_tpf
ends

state akimbo_xcoord2
ifvarn sgakimbo 0 ifvarn sgakimbo 1
	{
		setvarvar temp sgakimbo
		ifvarl sgakimbo -1 
		{ 
			mulvar temp -1 
			setvar tempb 10
			subvarvar tempb temp 
			setvarvar temp tempb 
		}
		mulvar temp -5
		addvarvar xweapon temp
	}
ends

state akimbo_ycoord2
ifvarn sgakimbo 0 ifvarn sgakimbo 1
	{
		setvarvar temp sgakimbo
		ifvarl sgakimbo -1 
		{ 
			mulvar temp -1 
			setvar tempb 10
			subvarvar tempb temp 
			setvarvar temp tempb 
		}
		mulvar temp 6
		addvarvar yweapon temp
	}
ends

state shotgunshellstate

	randvar zdist -256
	subvar zdist 768
	ezshootvar zdist NEWSHSHELL
	getactor[THISACTOR].x x
	getactor[THISACTOR].y y
	getplayer[THISACTOR].ang tmp
	setvarvar x2 x
	addvar x2 128
	rotatepoint x y x2 y tmp x3 y3
	setactor[RETURN].x x3
	setactor[RETURN].y y3
	
	getactor[RETURN].xoffset xoffset
	addvar xoffset -50
	setactor[RETURN].xoffset xoffset
	getplayer[THISACTOR].horiz tmp
	subvar tmp 100
	mulvar tmp 3
	divvar tmp 5
	getactor[RETURN].yoffset yoffset
	addvarvar yoffset tmp
	setactor[RETURN].yoffset yoffset
	getplayer[THISACTOR].ang ang
	addvar ang 768
	randvar tmp 256
	addvarvar ang tmp
	setactor[RETURN].ang ang
	getprojectile[NEWSHSHELL].vel tmp
	randvar tmp 32
	ifvarl tmp 12 { setvar tmp 12 }
	setprojectile[NEWSHSHELL].vel tmp
	
ends

state shotgunplayerstate
ifvare CURRWEAP 2
{
	getplayer[THISACTOR].kickback_pic tmp
	ifvare tmp 16
	{ 
		state shotgunshellstate 
		state shotgunshellstate 	
		getactor[RETURN].xoffset xoffset
		addvar xoffset -15
		setactor[RETURN].xoffset xoffset 
	}
}	
ifvare CURRWEAP 2 ifvarg sgakimbo 0
ifvare player[THISACTOR].kickback_pic 5
ifp palive
{
	ifvare shotgunalt 0
	{	
		sound SHOTFIRE
		
		setvar in1 16
		setvarvar tmp in1
		whilevarn tmp 0
		{
			shoot SHOTAMMO
			subvar tmp 1
		}

		getplayer[THISACTOR].ammo_amount 2 tmp
		ifvarg tmp 0 subvar tmp 1
		setplayer[THISACTOR].ammo_amount 2 tmp
	} 
}
ifvarn akimboshotgunalt 0 {
	switch akimboshotgunalt
		case 1
		getplayer[THISACTOR].ammo_amount 2 tmp
		ifvarg tmp 3 {
			sound SHOTFIR2
			setvar in1 96
			whilevarn in1 0 {
				shoot SHOTAMMO
				subvar in1 1
			}
			subvar tmp 4
			setplayer[THISACTOR].ammo_amount 2 tmp
		}
		break
		default break
	endswitch
		
	addvar akimboshotgunalt 1
	ifvarvarg akimboshotgunalt WEAPON2_TOTALTIME setvar akimboshotgunalt 0
}
//SHOTGUN AKIMBO

ifvarg sgakimbo 1 subvar sgakimbo 1
ifvarl sgakimbo -1
{
	addvar sgakimbo 1
	ifvare sgakimbo -1 setvar sgakimbo 0
}
ends

state shotgundisplayroom
ifvare CURRWEAP 2
{ 
	getplayer[THISACTOR].kickback_pic tmp
	ifvare tmp 1 { addvar camerahoriz 2 addvar cameraz -600 }
	ifvare tmp 2 { addvar camerahoriz 1 addvar cameraz -500 }
	ifvare tmp 3 { addvar cameraz -300 }
	ifvare shotgunalt 1 { ifvare tmp 1 { addvar camerahoriz 3 addvar cameraz -600 }
	ifvare tmp 2 { addvar camerahoriz 2 addvar cameraz -500 } ifvare tmp 3 { addvar cameraz -300 } }
	ifvare sgakimbo 1 { ifvare tmp 5 { addvar camerahoriz 2 addvar cameraz -600 }
	ifvare tmp 6 { addvar camerahoriz 1 addvar cameraz -500 }
	ifvare tmp 7 { addvar cameraz -300 } }
	ifvare akimboshotgunalt 1 { addvar camerahoriz 5 addvar cameraz -1200 }
	ifvare akimboshotgunalt 2 { addvar camerahoriz 3 addvar cameraz -1000 }
	ifvare akimboshotgunalt 3 { addvar camerahoriz 1 addvar cameraz -800 }
	ifvare akimboshotgunalt 4 { addvar cameraz -600 }
	ifvare akimboshotgunalt 5 { addvar cameraz -300 }
}
ends

state weaponshotgungame
ifvare CURRWEAP 2 
{ 
ifvarg player[THISACTOR].kickback_pic 12 { setvar shotgunaltdisplay 0 } 
getplayer[THISACTOR].ammo_amount 2 SHOTGUNAMMO
ifvare SHOTGUNAMMO 0 ifvare player[THISACTOR].weapon_pos 0 ifvare player[THISACTOR].kickback_pic 0 { setvar changeweappos 5 setplayer[THISACTOR].weapon_pos -1 }
}
ends

state shotgunaltstate
ifvare CURRWEAP 2
{
	ifvare shotgunalt 0
	ifvare akimboshotgunalt 0
	ifvare player[THISACTOR].weapon_pos 0
	ifp palive
	{
		getplayer[THISACTOR].kickback_pic temp
		ifvare temp 0
		{
			getplayer[THISACTOR].ammo_amount 2 SHOTGUNAMMO
			ifvarg SHOTGUNAMMO 0 
			{
			ifvarl sgakimbo 1 { setvar shotgunalt 1 setplayer[THISACTOR].kickback_pic 1 setvar shotgunaltdisplay 1 } else ifvarg SHOTGUNAMMO 3 setvar akimboshotgunalt 1
			} 
		}
	}
}
ends

state akimboshotgunaltdisplay

setvar qav_maxframes 13
setvar qav_tpf 7
state qav_initfralt2

switch qav_frame
case 0
setvar tilenumweapon 2629
setvar orientationweapon 0
setvar xweapon 78
setvar yweapon -9
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state
setvar tilenumweapon 2630
setvar orientationweapon 0
setvar xweapon 57
setvar yweapon -2
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state
setvar tilenumweapon 2631
setvar orientationweapon 0
setvar xweapon 100
setvar yweapon 3
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state

setvar tilenumweapon 2629
setvar orientationweapon 4
setvar xweapon -78
setvar yweapon -9
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state
setvar tilenumweapon 2630
setvar orientationweapon 4
setvar xweapon -57
setvar yweapon -2
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state
setvar tilenumweapon 2631
setvar orientationweapon 4
setvar xweapon -100
setvar yweapon 3
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state
break
case 1
setvar tilenumweapon 3157
setvar orientationweapon 0
setvar xweapon 57
setvar yweapon -48
setvar qav_sh -128
setvarvar qav_pal 0
setvar weapon_zoom 11250
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state
setvar tilenumweapon 3157
setvar orientationweapon 4
setvar xweapon -57
setvar yweapon -48
setvar qav_sh -128
setvarvar qav_pal 0
setvar weapon_zoom 11250
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state

setvar tilenumweapon 2629
setvar orientationweapon 0
setvar xweapon 95
setvar yweapon 23
setvar qav_sh -128
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state
setvar tilenumweapon 2632
setvar orientationweapon 0
setvar xweapon 91
setvar yweapon -3
setvar qav_sh -128
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state

setvar tilenumweapon 2629
setvar orientationweapon 4
setvar xweapon -95
setvar yweapon 23
setvar qav_sh -128
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state
setvar tilenumweapon 2632
setvar orientationweapon 4
setvar xweapon -91
setvar yweapon -3
setvar qav_sh -128
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state
break
case 2
setvar tilenumweapon 3158
setvar orientationweapon 0
setvar xweapon 51
setvar yweapon -53
setvar qav_sh -128
setvarvar qav_pal 0
setvar weapon_zoom 10625
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state
setvar tilenumweapon 3158
setvar orientationweapon 4
setvar xweapon -51
setvar yweapon -53
setvar qav_sh -128
setvarvar qav_pal 0
setvar weapon_zoom 10625
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state

setvar tilenumweapon 2629
setvar orientationweapon 0
setvar xweapon 100
setvar yweapon 35
setvar qav_sh -36
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state

setvar tilenumweapon 2629
setvar orientationweapon 4
setvar xweapon -100
setvar yweapon 35
setvar qav_sh -36
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state
break
case 3
setvar tilenumweapon 3159
setvar orientationweapon 0
setvar xweapon 55
setvar yweapon -50
setvar qav_sh -128
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state
setvar tilenumweapon 3158
setvar orientationweapon 4
setvar xweapon -55
setvar yweapon -50
setvar qav_sh -128
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state
break
case 4 case 5 case 6 case 7 break
case 8
setvar tilenumweapon 2629
setvar orientationweapon 0
setvar xweapon 99
setvar yweapon 34
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state
setvar tilenumweapon 2629
setvar orientationweapon 4
setvar xweapon -99
setvar yweapon 34
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state
break
case 9
setvar tilenumweapon 2629
setvar orientationweapon 0
setvar xweapon 94
setvar yweapon 23
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state
setvar tilenumweapon 2629
setvar orientationweapon 4
setvar xweapon -94
setvar yweapon 23
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state
break
case 10
setvar tilenumweapon 2629
setvar orientationweapon 0
setvar xweapon 87
setvar yweapon 8
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state
setvar tilenumweapon 2629
setvar orientationweapon 4
setvar xweapon -87
setvar yweapon 8
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state
break
case 11
setvar tilenumweapon 2629
setvar orientationweapon 0
setvar xweapon 81
setvar yweapon -4
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state
setvar tilenumweapon 2630
setvar orientationweapon 0
setvar xweapon 60
setvar yweapon 3
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state
setvar tilenumweapon 2631
setvar orientationweapon 0
setvar xweapon 103
setvar yweapon 8
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state

setvar tilenumweapon 2629
setvar orientationweapon 4
setvar xweapon -81
setvar yweapon -4
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state
setvar tilenumweapon 2630
setvar orientationweapon 4
setvar xweapon -60
setvar yweapon 3
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state
setvar tilenumweapon 2631
setvar orientationweapon 4
setvar xweapon -103
setvar yweapon 8
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state
break
case 12
setvar tilenumweapon 2629
setvar orientationweapon 0
setvar xweapon 78
setvar yweapon -9
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state
setvar tilenumweapon 2630
setvar orientationweapon 0
setvar xweapon 57
setvar yweapon -2
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state
setvar tilenumweapon 2631
setvar orientationweapon 0
setvar xweapon 100
setvar yweapon 3
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state

setvar tilenumweapon 2629
setvar orientationweapon 4
setvar xweapon -78
setvar yweapon -9
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state
setvar tilenumweapon 2630
setvar orientationweapon 4
setvar xweapon -57
setvar yweapon -2
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state
setvar tilenumweapon 2631
setvar orientationweapon 4
setvar xweapon -100
setvar yweapon 3
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state
break
endswitch

ends

state shotgunakimbodisplay
ifvarn akimboshotgunalt 0 { state akimboshotgunaltdisplay break }

setvar qav_maxframes 9
setvar qav_tpf 7
state qav_initframes2

switch qav_frame
case 0
case 1
setvar tilenumweapon 2629
setvar orientationweapon 0
setvar xweapon 78
setvar yweapon -9
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state
setvar tilenumweapon 2630
setvar orientationweapon 0
setvar xweapon 57
setvar yweapon -2
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state
setvar tilenumweapon 2631
setvar orientationweapon 0
setvar xweapon 100
setvar yweapon 3
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state

setvar tilenumweapon 2629
setvar orientationweapon 4
setvar xweapon -78
setvar yweapon -9
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state
setvar tilenumweapon 2630
setvar orientationweapon 4
setvar xweapon -57
setvar yweapon -2
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state
setvar tilenumweapon 2631
setvar orientationweapon 4
setvar xweapon -100
setvar yweapon 3
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state
break
case 2
setvar tilenumweapon 3157
setvar orientationweapon 4
setvar xweapon -60
setvar yweapon -48
setvar qav_sh -128
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state

setvar tilenumweapon 2629
setvar orientationweapon 0
setvar xweapon 76
setvar yweapon -11
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state

setvar tilenumweapon 2629
setvar orientationweapon 4
setvar xweapon -96
setvar yweapon 12
setvar qav_sh -128
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state
setvar tilenumweapon 2632
setvar orientationweapon 4
setvar xweapon -92
setvar yweapon -14
setvar qav_sh -128
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state
break
case 3
setvar tilenumweapon 3158
setvar orientationweapon 4
setvar xweapon -55
setvar yweapon -54
setvar qav_sh -128
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state

setvar tilenumweapon 2629
setvar orientationweapon 0
setvar xweapon 73
setvar yweapon -13
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state

setvar tilenumweapon 2629
setvar orientationweapon 4
setvar xweapon -103
setvar yweapon 23
setvar qav_sh -36
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state
break
case 4
setvar tilenumweapon 3159
setvar orientationweapon 4
setvar xweapon -60
setvar yweapon -51
setvar qav_sh -128
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state

setvar tilenumweapon 2629
setvar orientationweapon 0
setvar xweapon 70
setvar yweapon -14
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state

setvar tilenumweapon 2629
setvar orientationweapon 4
setvar xweapon -106
setvar yweapon 28
setvar qav_sh -24
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state
break
case 5
setvar tilenumweapon 3157
setvar orientationweapon 0
setvar xweapon 46
setvar yweapon -53
setvar qav_sh -128
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state
setvar tilenumweapon 2629
setvar orientationweapon 0
setvar xweapon 93
setvar yweapon 15
setvar qav_sh -128
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state
setvar tilenumweapon 2632
setvar orientationweapon 0
setvar xweapon 89
setvar yweapon -11
setvar qav_sh -128
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state

setvar tilenumweapon 2629
setvar orientationweapon 4
setvar xweapon -104
setvar yweapon 24
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state
break
case 6
setvar tilenumweapon 3158
setvar orientationweapon 0
setvar xweapon 44
setvar yweapon -59
setvar qav_sh -128
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state
setvar tilenumweapon 2629
setvar orientationweapon 0
setvar xweapon 100
setvar yweapon 23
setvar qav_sh -36
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state

setvar tilenumweapon 2629
setvar orientationweapon 4
setvar xweapon -93
setvar yweapon 8
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state
break
case 7
setvar tilenumweapon 3159
setvar orientationweapon 0
setvar xweapon 51
setvar yweapon -57
setvar qav_sh -128
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state
setvar tilenumweapon 2629
setvar orientationweapon 0
setvar xweapon 98
setvar yweapon 19
setvar qav_sh -24
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state

setvar tilenumweapon 2629
setvar orientationweapon 4
setvar xweapon -84
setvar yweapon -4
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state
break
case 8
setvar tilenumweapon 2629
setvar orientationweapon 0
setvar xweapon 89
setvar yweapon 3
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 0
state akimbo_xcoord2
state qav2tc_state

setvar tilenumweapon 2629
setvar orientationweapon 4
setvar xweapon -78
setvar yweapon -9
setvar qav_sh 0
setvarvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 1024
state akimbo_ycoord2
state qav2tc_state
break
endswitch
ends

state shotgundisplay
setvar qav_maxframes 9
setvar qav_tpf 5
state qav_initframes2

getplayer[THISACTOR].ammo_amount 2 SHOTGUNAMMO
andvar SHOTGUNAMMO 1

switch qav_frame
case 0
setvar tilenumweapon 2629
setvar orientationweapon 0
setvar xweapon 28
setvar yweapon -15
setvar qav_sh 0
setvar qav_pal 0
setvar weapon_zoom 10000
setvar qav_ang 0
state qav2tc_state
ifvare SHOTGUNAMMO 0
{
	setvar tilenumweapon 2630
	setvar weapon_zoom 10000
	setvar xweapon 7
	setvar yweapon -8
	state qav2tc_state
	
	setvar tilenumweapon 2631
	setvar weapon_zoom 10000
	setvar xweapon 50
	setvar yweapon -3
	state qav2tc_state
} else
{
	setvar tilenumweapon 2631
	setvar weapon_zoom 10000
	setvar xweapon 50
	setvar yweapon -3
	state qav2tc_state
}	
break
case 1
setvar orientationweapon 0
ifvarn shotgunaltdisplay 1
{
	setvar tilenumweapon 3157
	setvar qav_sh -128
	setvar weapon_zoom 10000
	ifvare SHOTGUNAMMO 1
	{
		setvar xweapon 1
		setvar yweapon -51
	} else
	{
		setvar xweapon 20
		setvar yweapon -51
	}
	state qav2tc_state
}
else
{
	setvar tilenumweapon 3157
	setvar xweapon 12
	setvar yweapon -51
	setvar qav_sh -128
	setvar weapon_zoom 13000
	state qav2tc_state
}
setvar tilenumweapon 2629
setvar xweapon 34
setvar yweapon -5
setvar weapon_zoom 10000
state qav2tc_state

ifvare SHOTGUNAMMO 1
{	
	setvar tilenumweapon 2631
	setvar weapon_zoom 10000
	setvar xweapon 56
	setvar yweapon 7
	state qav2tc_state
} 

setvar tilenumweapon 2632
setvar xweapon 30
setvar yweapon -31
setvar weapon_zoom 10000
state qav2tc_state
break
case 2
setvar orientationweapon 0
ifvarn shotgunaltdisplay 1
{
	setvar tilenumweapon 3157
	setvar qav_sh -128
	setvar weapon_zoom 10000
	ifvare SHOTGUNAMMO 1
	{
		setvar xweapon 1
		setvar yweapon -51
	} else
	{
		setvar xweapon 20
		setvar yweapon -51
	}
	state qav2tc_state
	setvar tilenumweapon 2629
	setvarvar qav_sh -32
	setvar xweapon 42
	setvar yweapon 10
	setvar weapon_zoom 10000
	state qav2tc_state
} else
{
	setvar tilenumweapon 3157
	setvar xweapon 12
	setvar yweapon -51
	setvar qav_sh -128
	setvar weapon_zoom 13000
	state qav2tc_state
	setvar tilenumweapon 2629
	setvarvar qav_sh -32
	setvar xweapon 44
	setvar yweapon 15
	setvar weapon_zoom 10000
	state qav2tc_state
}
break
case 3
setvar orientationweapon 0
ifvarn shotgunaltdisplay 1
{
	setvar tilenumweapon 3158
	setvarvar qav_sh -128
	setvar weapon_zoom 10000
	ifvare SHOTGUNAMMO 1
	{
		setvar xweapon 1
		setvar yweapon -60
	} else
	{
		setvar xweapon 16
		setvar yweapon -60
	}
	state qav2tc_state
	setvar tilenumweapon 2629
	setvarvar qav_sh -24
	setvar xweapon 45
	setvar yweapon 17
	setvar weapon_zoom 10000
	state qav2tc_state
} else
{
	setvar tilenumweapon 3158
	setvar xweapon 8
	setvar yweapon -60
	setvar qav_sh -128
	setvar weapon_zoom 13000
	state qav2tc_state
	setvar tilenumweapon 2629
	setvarvar qav_sh -24
	setvar xweapon 49
	setvar yweapon 29
	setvar weapon_zoom 10000
	state qav2tc_state
}
break
case 4
setvar orientationweapon 0
ifvarn shotgunaltdisplay 1
{
	setvar tilenumweapon 3158
	setvarvar qav_sh -128
	setvar weapon_zoom 10000
	ifvare SHOTGUNAMMO 1
	{
		setvar xweapon 1
		setvar yweapon -60
	} else
	{
		setvar xweapon 16
		setvar yweapon -60
	}
	state qav2tc_state
	setvar tilenumweapon 2629
	setvar qav_sh 0
	setvar xweapon 45
	setvar yweapon 14
	setvar weapon_zoom 10000
	state qav2tc_state
}
else
{
	setvar tilenumweapon 3158
	setvar xweapon 8
	setvar yweapon -60
	setvar qav_sh -128
	setvar weapon_zoom 13000
	state qav2tc_state
	
	setvar tilenumweapon 2629
	setvar qav_sh 0
	setvar xweapon 51
	setvar yweapon 34
	setvar weapon_zoom 10000
	state qav2tc_state
}
break
case 5
setvar orientationweapon 0
ifvarn shotgunaltdisplay 1
{
	setvar tilenumweapon 3159
	setvarvar qav_sh -128
	setvar weapon_zoom 10000
	ifvare SHOTGUNAMMO 1
	{
		setvar xweapon 7
		setvar yweapon -59
	} else
	{
		setvar xweapon 21
		setvar yweapon -59
	}
	state qav2tc_state
	setvar tilenumweapon 2629
	setvar qav_sh 0
	setvar xweapon 40
	setvar yweapon 5
	setvar weapon_zoom 10000
	state qav2tc_state
	ifvare SHOTGUNAMMO 1
	{	
		setvar tilenumweapon 2631
		setvar weapon_zoom 10000
		setvar xweapon 62
		setvar yweapon 17
		state qav2tc_state
	} 
}
else
{
	setvar tilenumweapon 3159
	setvar xweapon 16
	setvar yweapon -58
	setvar qav_sh -128
	setvar weapon_zoom 13000
	state qav2tc_state
	
	setvar tilenumweapon 2629
	setvar qav_sh 0
	setvar xweapon 51
	setvar yweapon 32
	setvar weapon_zoom 10000
	state qav2tc_state
}
break
case 6
setvar orientationweapon 0
ifvarn shotgunaltdisplay 1
{
	setvar tilenumweapon 3159
	setvarvar qav_sh -128
	setvar weapon_zoom 10000
	ifvare SHOTGUNAMMO 1
	{
		setvar xweapon 7
		setvar yweapon -59
	} else
	{
		setvar xweapon 21
		setvar yweapon -59
	}
	state qav2tc_state
	setvar tilenumweapon 2629
	setvar qav_sh 0
	setvar xweapon 35
	setvar yweapon -3
	setvar weapon_zoom 10000
	state qav2tc_state
	ifvare SHOTGUNAMMO 1
	{	
		setvar tilenumweapon 2631
		setvar weapon_zoom 10000
		setvar xweapon 57
		setvar yweapon 9
		state qav2tc_state
	} 
}
else
{
	setvar tilenumweapon 3159
	setvar xweapon 16
	setvar yweapon -58
	setvar qav_sh -128
	setvar weapon_zoom 13000
	state qav2tc_state
	
	setvar tilenumweapon 2629
	setvar qav_sh 0
	setvar xweapon 46
	setvar yweapon 16
	setvar weapon_zoom 10000
	state qav2tc_state
}
break
case 7
setvar orientationweapon 0
ifvarn shotgunaltdisplay 1
{
	setvar tilenumweapon 2629
	setvar qav_sh 0
	setvar xweapon 31
	setvar yweapon -10
	setvar weapon_zoom 10000
	state qav2tc_state
	ifvare SHOTGUNAMMO 1
	{	
		setvar tilenumweapon 2631
		setvar weapon_zoom 10000
		setvar xweapon 53
		setvar yweapon 2
		state qav2tc_state
	} 
}
else
{
	setvar tilenumweapon 2629
	setvar qav_sh 0
	setvar xweapon 37
	setvar yweapon 0
	setvar weapon_zoom 10000
	state qav2tc_state
}
break
case 8
setvar orientationweapon 0
ifvarn shotgunaltdisplay 1
{
	setvar tilenumweapon 2629
	setvar qav_sh 0
	setvar xweapon 28
	setvar yweapon -15
	setvar weapon_zoom 10000
	state qav2tc_state
	ifvare SHOTGUNAMMO 1
	{	
		setvar tilenumweapon 2631
		setvar weapon_zoom 10000
		setvar xweapon 50
		setvar yweapon -3
		state qav2tc_state
	} 
}
else
{
	setvar tilenumweapon 2629
	setvar qav_sh 0
	setvar xweapon 28
	setvar yweapon -15
	setvar weapon_zoom 10000
	state qav2tc_state
}
break

//SHOTL1.QAV
case 9 //0
setvar tilenumweapon 3161
setvar orientationweapon 0
setvar qav_sh 0
setvar xweapon 31
setvar yweapon -20
setvar weapon_zoom 10000
setvar qav_ang 0
state qav2tc_state
break
case 10 //1
setvar tilenumweapon 3161
setvar orientationweapon 0
setvar qav_sh 0
setvar xweapon 27
setvar yweapon -28
setvar weapon_zoom 10000
state qav2tc_state
break
case 11 //2
setvar tilenumweapon 3162
setvar orientationweapon 0
setvar qav_sh 0
setvar xweapon 17
setvar yweapon -24
setvar weapon_zoom 10000
state qav2tc_state
break
case 12 //3
setvar tilenumweapon 3162
setvar orientationweapon 0
setvar qav_sh 0
setvar xweapon 15
setvar yweapon -27
setvar weapon_zoom 10000
state qav2tc_state
break
case 13 //4
setvar tilenumweapon 3163
setvar orientationweapon 0
setvar qav_sh 0
setvar xweapon 1
setvar yweapon -27
setvar weapon_zoom 10000
state qav2tc_state
break
case 14 //5
setvar tilenumweapon 3163
setvar orientationweapon 0
setvar qav_sh 0
setvar xweapon 1
setvar yweapon -27
setvar qav_ang 0
setvar weapon_zoom 10000
state qav2tc_state
setvar tilenumweapon 3164
setvar qav_sh 0
setvar xweapon 121
setvar yweapon 12
setvar qav_ang 1920
setvar weapon_zoom 10000
state qav2tc_state
break
case 15 //6
setvar orientationweapon 0
setvar tilenumweapon 3163
setvar qav_sh 0
setvar xweapon 1
setvar yweapon -27
setvar qav_ang 0
setvar weapon_zoom 10000
state qav2tc_state

setvar tilenumweapon 3164
setvar qav_sh 0
setvar xweapon 109
setvar yweapon -15
setvar qav_ang 1920
setvar weapon_zoom 10000
state qav2tc_state
break
case 16 //7
setvar orientationweapon 0
setvar tilenumweapon 3163
setvar qav_sh 0
setvar xweapon 1
setvar yweapon -27
setvar qav_ang 0
setvar weapon_zoom 10000
state qav2tc_state

setvar tilenumweapon 3164
setvar qav_sh 0
setvar xweapon 97
setvar yweapon -35
setvar qav_ang 1920
setvar weapon_zoom 10000
state qav2tc_state
break
case 17 //8
setvar orientationweapon 0
setvar tilenumweapon 3163
setvar qav_sh 0
setvar xweapon 1
setvar yweapon -27
setvar qav_ang 0
setvar weapon_zoom 10000
state qav2tc_state

setvar tilenumweapon 3164
setvar qav_sh 0
setvar xweapon 76
setvar yweapon -45
setvar qav_ang 0
setvar weapon_zoom 10000
state qav2tc_state
break

case 18 //9
setvar tilenumweapon 3163
setvar orientationweapon 0
setvar qav_sh 0
setvar xweapon 1
setvar yweapon -27
setvar qav_ang 0
setvar weapon_zoom 10000
state qav2tc_state

setvar tilenumweapon 3165
setvar qav_sh 0
setvar xweapon 42
setvar yweapon -38
setvar weapon_zoom 10000
state qav2tc_state
break

case 19 //10
setvar tilenumweapon 3163
setvar orientationweapon 0
setvar qav_sh 0
setvar xweapon -5
setvar yweapon -22
setvar weapon_zoom 10000
state qav2tc_state

setvar tilenumweapon 3165
setvar qav_sh 0
setvar xweapon 33
setvar yweapon -33
setvar weapon_zoom 10000
state qav2tc_state
break

case 20 //11
setvar tilenumweapon 3166
setvar orientationweapon 0
setvar qav_sh 0
setvar xweapon 51
setvar yweapon -35
setvar weapon_zoom 10000
state qav2tc_state
break

case 21 //12
setvar tilenumweapon 3166
setvar orientationweapon 0
setvar qav_sh 0
setvar xweapon 45
setvar yweapon -18
setvar weapon_zoom 10000
state qav2tc_state
break
case 22 //13
setvar tilenumweapon 3166
setvar orientationweapon 0
setvar qav_sh 0
setvar xweapon 41
setvar yweapon -5
setvar weapon_zoom 10000
state qav2tc_state
break

endswitch

ends

state shotgunshotrange
ifvare CURRWEAP 2
{
	ifvare sgakimbo 1 {
		ifvarn akimboshotgunalt 0 {	setvar ANGRANGE 256 setvar ZRANGE 768 } else
		{ setvar ANGRANGE 128 setvar ZRANGE 512 } 
	}
}
ends

state shotgunfirestate
ifvare CURRWEAP 2
{
	ifvarg sgakimbo 1 setvar RETURN -1
	ifvarl sgakimbo -1 setvar RETURN -1
}
ifvarn akimboshotgunalt 0 setvar RETURN -1
ends

state shotgundofirestate
ifvare CURRWEAP 2
{
	ifvare shotgunalt 1
	{
		getplayer[THISACTOR].ammo_amount 2 SHOTGUNAMMO
		andvar SHOTGUNAMMO 1
		ifvare SHOTGUNAMMO 0
		{
		   getplayer[THISACTOR].ammo_amount 2 SHOTGUNAMMO
		   subvar SHOTGUNAMMO 1
		   setplayer[THISACTOR].ammo_amount 2 SHOTGUNAMMO
		   setvar WEAPON2_SHOTSPERBURST 32
		   setvar WEAPON2_FIRESOUND SHOTFIR2
		}
		ifvarl sgakimbo 1 { setvar shotgunalt 0 }
    } else
    {
	  setvar WEAPON2_SHOTSPERBURST 16
      setvar WEAPON2_FIRESOUND SHOTFIRE
    }
}
ends