
defineprojectile TNTBUNDLE PROJ_WORKSLIKE 6146 //6286
defineprojectile TNTBUNDLE PROJ_HITRADIUS 0
defineprojectile TNTBUNDLE PROJ_BSOUND -1
defineprojectile TNTBUNDLE PROJ_VEL 256
defineprojectile TNTBUNDLE PROJ_DROP -368
defineprojectile TNTBUNDLE PROJ_XREPEAT 24
defineprojectile TNTBUNDLE PROJ_YREPEAT 24
defineprojectile TNTBUNDLE PROJ_EXTRA 0
defineprojectile TNTBUNDLE PROJ_CSTAT 0
defineprojectile TNTBUNDLE PROJ_SPAWNS -1
actor TNTBUNDLE 0 NO enda

defineprojectile REMOTEBUNDLE PROJ_WORKSLIKE 6150
defineprojectile REMOTEBUNDLE PROJ_HITRADIUS 0
defineprojectile REMOTEBUNDLE PROJ_BSOUND -1
defineprojectile REMOTEBUNDLE PROJ_CSTAT 0
defineprojectile REMOTEBUNDLE PROJ_VEL 256
defineprojectile REMOTEBUNDLE PROJ_DROP -368
defineprojectile REMOTEBUNDLE PROJ_XREPEAT 24
defineprojectile REMOTEBUNDLE PROJ_YREPEAT 24
defineprojectile REMOTEBUNDLE PROJ_EXTRA 0
defineprojectile REMOTEBUNDLE PROJ_SPAWNS -1
actor REMOTEBUNDLE 0 NO enda

defineprojectile PROXIMITYBUNDLE PROJ_WORKSLIKE 6150
defineprojectile PROXIMITYBUNDLE PROJ_HITRADIUS 0
defineprojectile PROXIMITYBUNDLE PROJ_BSOUND -1
defineprojectile PROXIMITYBUNDLE PROJ_CSTAT 0
defineprojectile PROXIMITYBUNDLE PROJ_VEL 256
defineprojectile PROXIMITYBUNDLE PROJ_DROP -368
defineprojectile PROXIMITYBUNDLE PROJ_XREPEAT 24
defineprojectile PROXIMITYBUNDLE PROJ_YREPEAT 24
defineprojectile PROXIMITYBUNDLE PROJ_EXTRA 0
defineprojectile PROXIMITYBUNDLE PROJ_SPAWNS PROXIMITYFLOOR
actor PROXIMITYBUNDLE 0 NO enda

gamevar WEAPON5_TOTALTIME 22 1
gamevar WEAPON5_FIREDELAY 14 1
gamevar WEAPON5_HOLDDELAY 15 1

gamevar WEAPON10_TOTALTIME 13 1
gamevar WEAPON10_FIREDELAY 7 1

state weapondynamitekillit
ifactor TNTBUNDLE
{
	getactorvar[THISACTOR].detonatetime tmp
	espawn TNTFLOOR
	setactorvar[RETURN].detonatetime tmp
	setvar RETURN 0
}
ifactor TNTBUNDLE2
{
	getactorvar[THISACTOR].detonatetime tmp
	espawn TNTFLOOR
	setactorvar[RETURN].detonatetime tmp
	setvar RETURN 0
}
ifactor REMOTEBUNDLE
{
	getactorvar[THISACTOR].remoteplayer perplayer
	getplayer[perplayer].hbomb_on hbomb_on
	ifvarn hbomb_on 0 espawn REMOTEFLOOR
	setactorvar[RETURN].remoteplayer perplayer
	setvar RETURN 0
}
ends

state weapondynamitegame
ifactor TNTBUNDLE
{
	ifinwater nullop else
	ifceilingdistl 10 
	ifvare proj_shoot 0
	{
		getactor[THISACTOR].zvel zvel
		mulvar zvel -1
		setactor[THISACTOR].zvel zvel
		setvar proj_shoot 1
	}
	
	espawn NAPALMSMOKE
	getactor[RETURN].x x
	getactor[RETURN].y y
	getactor[RETURN].ang ang
	setvarvar y2 y
	addvar y2 -128
	rotatepoint x y x y2 ang x3 y3
	setactor[RETURN].x x3
	setactor[RETURN].y y3

	setactor[RETURN].xrepeat 5
	setactor[RETURN].yrepeat 5
	
	getprojectile[TNTBUNDLE].workslike tmp
	ifvare tmp 6150
	{
		getactor[THISACTOR].z z
		getactor[THISACTOR].sectnum sectnum
		getsector[sectnum].floorz z2
		subvarvar z2 z
		ifvarl z2 2000 { setprojectile[TNTBUNDLE].vel 256 setactor[THISACTOR].zvel 0 } 
		ifvarl z2 400 { setactor[THISACTOR].xrepeat 24 setactor[THISACTOR].yrepeat 24 action FRAMEMINUS3 }
	}
	
}


ifactor TNTBUNDLE2
{
	getactor[THISACTOR].z z
	getactor[THISACTOR].sectnum sectnum
	getsector[sectnum].floorz z2
	subvarvar z2 z
	ifvarl z2 2000 { setprojectile[TNTBUNDLE2].vel 256 setactor[THISACTOR].zvel 0 } 
	ifvarl z2 400 { setactor[THISACTOR].xrepeat 24 setactor[THISACTOR].yrepeat 24 action FRAMEMINUS2 }
}

ifactor REMOTEBUNDLE
{
	ifvare player[remoteplayer].hbomb_on 0
	{ 
		spawn EXPLOSION4 
		hitradius 2048 60 100 160 300
		globalsound EXPLODCM
		killit 
		setplayer[remoteplayer].hbomb_on 1
	}
	
	getactor[THISACTOR].z z
	getactor[THISACTOR].sectnum sectnum
	getsector[sectnum].floorz z2
	subvarvar z2 sprite[THISACTOR].z
	ifvarl z2 2000 { setprojectile[REMOTEBUNDLE].vel 256 setactor[THISACTOR].zvel 0 } 
	ifvarl z2 400 { setactor[THISACTOR].xrepeat 32 setactor[THISACTOR].yrepeat 32 action FRAMEMINUS2 }

}
ifactor PROXIMITYBUNDLE
{
	getactor[THISACTOR].z z
	getactor[THISACTOR].sectnum sectnum
	getsector[sectnum].floorz z2
	subvarvar z2 z
	ifvarl z2 2000 { setprojectile[PROXIMITYBUNDLE].vel 256 setactor[THISACTOR].zvel 0 } 
	ifvarl z2 400 { setactor[THISACTOR].xrepeat 32 setactor[THISACTOR].yrepeat 32 action FRAMEMINUS2 }
}
ifactor HEAVYHBOMB { killit }
ifactor TNTFLOOR { addvar detonatecount 1 }
ifactor APLAYER
{
	ifvarg PROXIMITYMINE_AMMOAMOUNT 50 setvar PROXIMITYMINE_AMMOAMOUNT 50
	ifvarg REMOTETNT_AMMOAMOUNT 50 setvar REMOTETNT_AMMOAMOUNT 50
	ifvarg TNT_AMMOAMOUNT 50 setvar TNT_AMMOAMOUNT 50
}
ends

state weapondynamiteegs

getactor[THISACTOR].picnum picnum
	switch picnum
		case HEAVYHBOMB
		ifvare WEAPON_VAR_TNT 1
		{
			ifp palive setvar SHOOTTNT 1
			ifvare TNTFLOORALT 1 { setprojectile[TNTBUNDLE].workslike 6150 } else setprojectile[TNTBUNDLE].workslike 6146
		}
		ifvare WEAPON_VAR_TNT 2
		{
			ifp palive setvar SHOOTTNT 2
		}
		ifvare WEAPON_VAR_TNT 3
		{
			ifp palive setvar SHOOTTNT 3
		}
		break
		case TNTFLOOR
		ifvare TNTFLOORALT 1 { setactor[THISACTOR].pal 30 setvar TNTFLOORALT 0 }
		break
		case SPRAYFLOOR
		ifvare SPRAYFLOORALT 1 { setactor[THISACTOR].pal 30 setvar SPRAYFLOORALT 0 }
		break
	endswitch
	
ends

state dynamitealtstate
ifvare CURRWEAP 5
{
    ifvare WEAPON_VAR_TNT 1
	{
		ifvare tntalt 0
		ifvare player[THISACTOR].weapon_pos 0
		ifp palive
		{
			ifvare player[THISACTOR].kickback_pic 0
			{
				getplayer[THISACTOR].ammo_amount 5 temp
				ifvarg temp 0 { setprojectile[TNTBUNDLE].workslike 6146 setvar tntalt 1 }
			}
		} else
		ifvare tntalt 14
		{
		setplayer[THISACTOR].kickback_pic 28
		setprojectile[TNTBUNDLE].vel 0
		setvar TNTFLOORALT 1
		eshoot TNTBUNDLE
		setactorvar[RETURN].detonatetime dtime
		subvar TNT_AMMOAMOUNT 1
		ifvare TNT_AMMOAMOUNT 0
		{
			ifvare TNT_AMMOAMOUNT 0 ifvare REMOTETNT_AMMOAMOUNT 0 ifvare PROXIMITYMINE_AMMOAMOUNT 0 { setvar LIGHTERENABLE 0 setplayer[THISACTOR].weapon_pos 10 setvar changeweappos 5 } else
			{
				ifvarg REMOTETNT_AMMOAMOUNT 0 { setplayer[THISACTOR].kickback_pic 0 setplayer[THISACTOR].ammo_amount 5 REMOTETNT_AMMOAMOUNT setvar changeweappos 3 setplayer[THISACTOR].weapon_pos 10 } else
				ifvarg PROXIMITYMINE_AMMOAMOUNT 0 { setplayer[THISACTOR].kickback_pic 0 setplayer[THISACTOR].ammo_amount 5 PROXIMITYMINE_AMMOAMOUNT setvar changeweappos 2 setplayer[THISACTOR].weapon_pos 10 }
			}
		}
		setvar tntalt 0
		setvar dtime 0
		setprojectile[TNTBUNDLE].vel 256
		}
	}
	ifvare WEAPON_VAR_TNT 2
	{
		ifvare proxialt 0
		ifvare player[THISACTOR].weapon_pos 0
		ifp palive
		{
			ifvare player[THISACTOR].kickback_pic 0
			{
				setvar proxialt 1 
				setplayer[THISACTOR].kickback_pic 17
				setprojectile[PROXIMITYBUNDLE].vel 0
				eshoot PROXIMITYBUNDLE
				subvar PROXIMITYMINE_AMMOAMOUNT 1
				ifvare PROXIMITYMINE_AMMOAMOUNT 0
				{
					ifvare TNT_AMMOAMOUNT 0 ifvare REMOTETNT_AMMOAMOUNT 0 ifvare PROXIMITYMINE_AMMOAMOUNT 0 { setvar LIGHTERENABLE 0 setplayer[THISACTOR].weapon_pos 10 setvar changeweappos 5 } else
					{
						ifvarg TNT_AMMOAMOUNT 0 { setplayer[THISACTOR].kickback_pic 0 setplayer[THISACTOR].ammo_amount 5 TNT_AMMOAMOUNT setvar changeweappos 1 setplayer[THISACTOR].weapon_pos 10 } else
						{ ifvarg REMOTETNT_AMMOAMOUNT 0 { setplayer[THISACTOR].kickback_pic 0 setplayer[THISACTOR].ammo_amount 5 REMOTETNT_AMMOAMOUNT setvar changeweappos 3 setplayer[THISACTOR].weapon_pos 10 } }	
					}
				}
				setvar proxialt 0
				setprojectile[PROXIMITYBUNDLE].vel 256
			}
		}
	}
	ifvare WEAPON_VAR_TNT 3
	{
		
		ifvare player[THISACTOR].kickback_pic 20 { //готовность нажатие на кнопку
			setvar hbomb_reset 1
		}
		ifvare remotealt 0
		ifvare player[THISACTOR].weapon_pos 0
		ifp palive
		{
			ifvare player[THISACTOR].kickback_pic 0
			{
				setvar remotealt 1 
				setplayer[THISACTOR].hbomb_on 1
				setplayer[THISACTOR].kickback_pic 36
				setprojectile[REMOTEBUNDLE].vel 0
				getactorvar[THISACTOR].remoteplayer perplayer
				eshoot REMOTEBUNDLE
				setactorvar[RETURN].remoteplayer perplayer
				subvar REMOTETNT_AMMOAMOUNT 1
				setvar remotealt 0
				setprojectile[REMOTEBUNDLE].vel 256
			}
		}
	}
}
ends

state remotetntdisplay
 switch player[THISACTOR].kickback_pic 
	case 0
	case 1
	case 2
	case 3
	case 4
		setvar orientationweapon 0
		ifvare invisible 1 orvar orientationweapon 33
		ifvare detonat_fire 0
		{
		setvar xweapon 210
		setvar yweapon 250
		state hudcoordfix
		setvar tilenumweapon DYNAMITE
		addvar tilenumweapon 0
		myospal xweapon yweapon tilenumweapon shade orientationweapon palweapon
		setvar xweapon 180
		setvar yweapon 229
		state hudcoordfix
		setvar tilenumweapon DETONATOR
		addvar tilenumweapon -2
		myospal xweapon yweapon tilenumweapon shade orientationweapon palweapon
		}
	   	 setvar xweapon 70
		 setvar yweapon 166
		 setvar tilenumweapon DETONATOR
		 addvar tilenumweapon 0
		 state hudcoordfix addvar yweapon 80	
   		 myospal xweapon yweapon tilenumweapon shade orientationweapon palweapon
 		 divvar tmp 6
		 divvar tmp 10
		 modvar tmp 8
	     addvar xweapon 12
		 addvar yweapon -48
		 ifvare tmp 0 
 		 { rotatesprite xweapon yweapon 65536 0 8313 -128 palweapon orientationweapon 0 0 xdim ydim }
		 ifvare tmp 1
		 { 
		 addvar xweapon 4 rotatesprite xweapon yweapon 65536 0 8313 -128 palweapon orientationweapon 0 0 xdim ydim
		 addvar xweapon -4 myospal xweapon yweapon 8313 0 33 palweapon
		 }
		 ifvare tmp 2 
		 { 
		 addvar xweapon 8 rotatesprite xweapon yweapon 65536 0 8313 -128 palweapon orientationweapon 0 0 xdim ydim
		 addvar xweapon -4 myospal xweapon yweapon 8313 0 33 palweapon
		 }
		 ifvare tmp 3 
		 { 
		 addvar xweapon 12 rotatesprite xweapon yweapon 65536 0 8313 -128 palweapon orientationweapon 0 0 xdim ydim
		 addvar xweapon -4 myospal xweapon yweapon 8313 0 33 palweapon
		 }
		 ifvare tmp 4 
		 { 
		 addvar xweapon 12 rotatesprite xweapon yweapon 65536 0 8313 -128 palweapon orientationweapon 0 0 xdim ydim
  		 ifvare detonat_fire 0 { addvar xweapon 81 addvar yweapon 34 rotatesprite xweapon yweapon 65536 0 8324 -128 palweapon orientationweapon 0 0 xdim ydim }
		 }
		 ifvare tmp 5 
		 { 
		 addvar xweapon 8 rotatesprite xweapon yweapon 65536 0 8313 -128 palweapon orientationweapon 0 0 xdim ydim
		 addvar xweapon 4 myospal xweapon yweapon 8313 0 33 palweapon
		 ifvare detonat_fire 0 {  addvar xweapon 81 addvar yweapon 34 rotatesprite xweapon yweapon 65536 0 8324 -128 palweapon orientationweapon 0 0 xdim ydim }
		 }
		 ifvare tmp 6 
		 { 
		 addvar xweapon 4 rotatesprite xweapon yweapon 65536 0 8313 -128 palweapon orientationweapon 0 0 xdim ydim
		 addvar xweapon 4 myospal xweapon yweapon 8313 0 33 palweapon
         ifvare detonat_fire 0 {  addvar xweapon 85 addvar yweapon 34 rotatesprite xweapon yweapon 65536 0 8324 -128 palweapon orientationweapon 0 0 xdim ydim }
		 }
		 ifvare tmp 7 
		 { 
	  	 rotatesprite xweapon yweapon 65536 0 8313 -128 palweapon orientationweapon 0 0 xdim ydim
		 addvar xweapon 4 myospal xweapon yweapon 8313 0 33 palweapon
         ifvare detonat_fire 0 {  addvar xweapon 89 addvar yweapon 34 rotatesprite xweapon yweapon 65536 0 8324 -128 palweapon orientationweapon 0 0 xdim ydim }
		 } 		 
    break
	
	case 5 //case 1
	setvar xweapon	74
	setvar yweapon	171
	setvar tilenumweapon	DETONATOR
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 32 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	
	setvar xweapon	226
	setvar yweapon	188
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim
	
	setvar xweapon	196
	setvar yweapon	167
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	11
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	
	setvar xweapon	191
	setvar yweapon	170
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	12
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break	
		
		
	case 6 //case 2
	case 7
	setvar xweapon	78
	setvar yweapon	175
	setvar tilenumweapon	DETONATOR
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 60 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	
	setvar xweapon	231
	setvar yweapon	196
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim
	
	setvar xweapon	201
	setvar yweapon	175
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	11
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	break	
		
		
	case 8 //case 3
	setvar xweapon	83
	setvar yweapon	178
	setvar tilenumweapon	DETONATOR
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 88 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	
	setvar xweapon	245
	setvar yweapon	219
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim
	
	setvar xweapon	215
	setvar yweapon	198
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	11
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	

	break	
		
		
	case 9 //case 4
	case 10
	setvar xweapon	88
	setvar yweapon	181
	setvar tilenumweapon	DETONATOR
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 92 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	
	setvar xweapon	259
	setvar yweapon	243
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim
	break	
		
		
	case 11 //case 5
	setvar xweapon	88
	setvar yweapon	178
	setvar tilenumweapon	DETONATOR
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 44 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	break	
		
		
	case 12 //case 6
	case 13
	setvar xweapon	80
	setvar yweapon	169
	setvar tilenumweapon	DETONATOR
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	
	setvar xweapon	274
	setvar yweapon	221
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	33
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim
	break	
		
		
	case 14 //case 7
	setvar xweapon	70
	setvar yweapon	166
	setvar tilenumweapon	DETONATOR
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 2020 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	
	setvar xweapon	262
	setvar yweapon	197
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	33
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim
	break	
		
		
	case 15 //case 8
	setvar xweapon	55
	setvar yweapon	171
	setvar tilenumweapon	DETONATOR
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 2008 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	
	setvar xweapon	252
	setvar yweapon	166
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	34
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim
	break	
		
		
	case 16 //case 9
	setvar xweapon	49
	setvar yweapon	183
	setvar tilenumweapon	DETONATOR
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 2008 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	
	setvar xweapon	250
	setvar yweapon	164
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	34
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim
	break	
		
		
	case 17 //case 10
	setvar xweapon	58
	setvar yweapon	180
	setvar tilenumweapon	DETONATOR
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 2020 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	
	setvar xweapon	247
	setvar yweapon	197
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	34
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim
	break	
		
		
	case 18 //case 11
	setvar xweapon	64
	setvar yweapon	172
	setvar tilenumweapon	DETONATOR
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	
	setvar xweapon	247
	setvar yweapon	197
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	34
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim
	break	
		
		
	case 19 //case 12
	setvar xweapon	70
	setvar yweapon	166
	setvar tilenumweapon	DETONATOR
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	
	setvar xweapon	237
	setvar yweapon	224
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	33
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim
	break

    case 20 //Detonator ready
    case 21
    setvar xweapon 70
    setvar yweapon 166
	setvar tilenumweapon DETONATOR
    addvar tilenumweapon 0
	state hudcoordfix addvar yweapon 80	
    myospal xweapon yweapon tilenumweapon shade orientationweapon palweapon
		ifvarg player[THISACTOR].kickback_pic 19
		{
 		 divvar tmp 6
		 divvar tmp 10
		 modvar tmp 8
	     addvar xweapon 12
		 addvar yweapon -48
		 ifvare tmp 0 
 		 { rotatesprite xweapon yweapon 65536 0 8313 -128 palweapon orientationweapon 0 0 xdim ydim }
		 ifvare tmp 1
		 { 
		 addvar xweapon 4 rotatesprite xweapon yweapon 65536 0 8313 -128 palweapon orientationweapon 0 0 xdim ydim
		 addvar xweapon -4 myospal xweapon yweapon 8313 0 33 palweapon
		 }
		 ifvare tmp 2 
		 { 
		 addvar xweapon 8 rotatesprite xweapon yweapon 65536 0 8313 -128 palweapon orientationweapon 0 0 xdim ydim
		 addvar xweapon -4 myospal xweapon yweapon 8313 0 33 palweapon
		 }
		 ifvare tmp 3 
		 { 
		 addvar xweapon 12 rotatesprite xweapon yweapon 65536 0 8313 -128 palweapon orientationweapon 0 0 xdim ydim
		 addvar xweapon -4 myospal xweapon yweapon 8313 0 33 palweapon
		 }
		 ifvare tmp 4 
		 { addvar xweapon 12 rotatesprite xweapon yweapon 65536 0 8313 -128 palweapon orientationweapon 0 0 xdim ydim }
		 ifvare tmp 5 
		 { 
		 addvar xweapon 8 rotatesprite xweapon yweapon 65536 0 8313 -128 palweapon orientationweapon 0 0 xdim ydim
		 addvar xweapon 4 myospal xweapon yweapon 8313 0 33 palweapon
		 }
		 ifvare tmp 6 
		 { 
		 addvar xweapon 4 rotatesprite xweapon yweapon 65536 0 8313 -128 palweapon orientationweapon 0 0 xdim ydim
		 addvar xweapon 4 myospal xweapon yweapon 8313 0 33 palweapon
		 }
		 ifvare tmp 7 
		 { 
	  	 rotatesprite xweapon yweapon 65536 0 8313 -128 palweapon orientationweapon 0 0 xdim ydim
		 addvar xweapon 4 myospal xweapon yweapon 8313 0 33 palweapon
		 }  
		}
    break
	case 23 //Detonator fire
    case 24
	case 25
	setvar xweapon	79
	setvar yweapon	177
	setvar tilenumweapon	DETONATOR
	addvar tilenumweapon	1
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	break	
	case 26
	case 27
	setvar xweapon	82
	setvar yweapon	193
	setvar tilenumweapon	DETONATOR
	addvar tilenumweapon	1
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	break	
	case 28
	case 29
	setvar xweapon	85
	setvar yweapon	210
	setvar tilenumweapon	DETONATOR
	addvar tilenumweapon	1
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	break	
	case 30
	setvar xweapon	88
	setvar yweapon	230
	setvar tilenumweapon	DETONATOR
	addvar tilenumweapon	1
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	break	
	case	31 //REMUP2.QAV
	setvar xweapon	56
	setvar yweapon	222
	setvar tilenumweapon	DETONATOR
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	
	setvar xweapon	259
	setvar yweapon	243
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	

	break	
	case	32
	setvar xweapon	62
	setvar yweapon	198
	setvar tilenumweapon	DETONATOR
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim

	setvar xweapon	248
	setvar yweapon	219
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	
	setvar xweapon	217
	setvar yweapon	197
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	11
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	
	break	
	case	33
	setvar xweapon	68
	setvar yweapon	179
	setvar tilenumweapon	DETONATOR
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	
	setvar xweapon	231
	setvar yweapon	196
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim		

	setvar xweapon	201
	setvar yweapon	175
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	11
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	
	setvar xweapon	196
	setvar yweapon	179
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	12
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	

	break	
	case	34
	setvar xweapon	70
	setvar yweapon	169
	setvar tilenumweapon	DETONATOR
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	
	setvar xweapon	226
	setvar yweapon	188
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	

	setvar xweapon	196
	setvar yweapon	167
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	11
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	break	
	
	case	35
	setvar xweapon	70
	setvar yweapon	169
	setvar tilenumweapon	DETONATOR
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	
	setvar xweapon	221
	setvar yweapon	182
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	

	setvar xweapon	191
	setvar yweapon	161
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	11
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	break
	
	case 36 //REMDROP.QAV
	setvar xweapon	70
	setvar yweapon	166
	setvar tilenumweapon	DETONATOR
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	

	setvar xweapon	221
	setvar yweapon	182
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	

	setvar xweapon	191
	setvar yweapon	161
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	11
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	break
	
	case 37
	setvar xweapon	70
	setvar yweapon	166
	setvar tilenumweapon	DETONATOR
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	

	setvar xweapon	226
	setvar yweapon	188
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 1988 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	

	setvar xweapon	193
	setvar yweapon	173
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	11
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 1988 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	

	setvar xweapon	189
	setvar yweapon	177
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	12
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 1988 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break
	
	case 38
	setvar xweapon	70
	setvar yweapon	166
	setvar tilenumweapon	DETONATOR
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	

	setvar xweapon	231
	setvar yweapon	196
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 1908 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	

	setvar xweapon	195
	setvar yweapon	190
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	11
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 1908 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	break
	
	case 39
	setvar xweapon	70
	setvar yweapon	166
	setvar tilenumweapon	DETONATOR
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	
	setvar xweapon	235
	setvar yweapon	208
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 1836 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	

	setvar xweapon	199
	setvar yweapon	210
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	11
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 1836 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	break
	
	case 40
	setvar xweapon	70
	setvar yweapon	166
	setvar tilenumweapon	DETONATOR
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	

	break	
 endswitch
ends

state bunfuse
	switch dtime
	case 0
	case 1
	setvar xweapon	169
	setvar yweapon	155
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	setvar orientationweapon 0
	ifvare invisible 1 orvar orientationweapon 33
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break	
	case 2
	case 3
	case 4
	setvar xweapon	171
	setvar yweapon	157
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break	
	case 5
	case 6
	setvar xweapon	173
	setvar yweapon	158
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	4
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 7
	case 8
	case 9
	setvar xweapon	170
	setvar yweapon	153
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 56 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break	
	case 10
	case 11
	setvar xweapon	172
	setvar yweapon	157
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 12
	case 13
	case 14
	setvar xweapon	173
	setvar yweapon	158
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	4
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 15
	case 16
	setvar xweapon	169
	setvar yweapon	158
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 1984 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 17
	case 18
	case 19
	setvar xweapon	171
	setvar yweapon	158
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 20
	case 21
	setvar xweapon	173
	setvar yweapon	158
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	4
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 20 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 22
	case 23
	case 24
	setvar xweapon	171
	setvar yweapon	154
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 56 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 25 //15
	case 26
	setvar xweapon	172 //172 171
	setvar yweapon	154 //158 154
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 56 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break	
	case 27
	case 28
	case 29
	setvar xweapon	176
	setvar yweapon	157
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	4
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 53739 56 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 30
	case 31
	setvar xweapon	173
	setvar yweapon	155
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 53739 56 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 32
	case 33
	case 34
	setvar xweapon	173
	setvar yweapon	155
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 61603 56 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 35
	case 36
	case 37
	setvar xweapon	174
	setvar yweapon	158
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	4
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 12 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 38
	case 39
	case 40
	setvar xweapon	170
	setvar yweapon	160
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 1960 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 41
	case 42
	setvar xweapon	171
	setvar yweapon	161
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 1960 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 43
	case 44
	case 45
	setvar xweapon	174
	setvar yweapon	159
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	4
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 46
	case 47
	case 48
	setvar xweapon	170
	setvar yweapon	157
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 49
	case 50
	setvar xweapon	172
	setvar yweapon	157
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 51
	case 52
	case 53
	setvar xweapon	174
	setvar yweapon	158
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	4
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 54
	case 55
	setvar xweapon	171
	setvar yweapon	157
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break
	case 56
	case 57
	case 58
	setvar xweapon	174
	setvar yweapon	157
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 59
	case 60
	setvar xweapon	176
	setvar yweapon	159
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	4
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 61 //29
	case 62
	case 63
	setvar xweapon	173
	setvar yweapon	159
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64	
	ifvare invisible 1 { rotatesprite xweapon yweapon 65536 104 tilenumweapon -128 palweapon 37 0 0 xdim ydim } else  rotatesprite xweapon yweapon 65536 104 tilenumweapon -128 palweapon 4 0 0 xdim ydim
	break		
	case 64 //30
	case 65
	setvar xweapon	174
	setvar yweapon	160
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	ifvare invisible 1 { rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon 37 0 0 xdim ydim } else rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon 4 0 0 xdim ydim	
	break		
	case 66
	case 67
	case 68
	setvar xweapon	176
	setvar yweapon	160
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	4
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 2000 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 69
	case 70
	case 71
	setvar xweapon	173
	setvar yweapon	159
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 2000 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 72
	case 73
	setvar xweapon	178
	setvar yweapon	160
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	4
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 2000 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 74
	case 75
	case 76
	setvar xweapon	174
	setvar yweapon	159
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 2000 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 77
	case 78
	setvar xweapon	176
	setvar yweapon	158
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 79
	case 80
	setvar xweapon	178
	setvar yweapon	159
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	4
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 81
	case 82
	case 83
	setvar xweapon	175
	setvar yweapon	156
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break	
	case 84
	case 85
	setvar xweapon	176
	setvar yweapon	158
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 86 //39
	case 87
	case 88
	setvar xweapon	179
	setvar yweapon	159
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	4
	state hudcoordfix addvar yweapon 64	
	ifvare invisible 1 { rotatesprite xweapon yweapon 65536 52 tilenumweapon -128 palweapon 37 0 0 xdim ydim } else rotatesprite xweapon yweapon 65536 52 tilenumweapon -128 palweapon 4 0 0 xdim ydim 
	break		
	case 89
	case 90
	setvar xweapon	176
	setvar yweapon	155
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 52 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 91
	case 92
	setvar xweapon	179
	setvar yweapon	156
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 52 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 93
	case 94
	case 95
	setvar xweapon	181
	setvar yweapon	157
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	4
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 52 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 96
	case 97
	setvar xweapon	179
	setvar yweapon	156
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 52 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 98
	case 99
	case 100
	setvar xweapon	182
	setvar yweapon	157
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 52 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 101
	case 102
	setvar xweapon	184
	setvar yweapon	158
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	4
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 52 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 103 //46
	case 104
	case 105
	setvar xweapon	181
	setvar yweapon	162
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64	
	ifvare invisible 1 {  rotatesprite xweapon yweapon 65536 52 tilenumweapon -128 palweapon 37 0 0 xdim ydim	} else  rotatesprite xweapon yweapon 65536 52 tilenumweapon -128 palweapon 4 0 0 xdim ydim
	break		
	case 106
	case 107
	setvar xweapon	183
	setvar yweapon	157
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 52 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 108
	case 109
	case 110
	setvar xweapon	185
	setvar yweapon	156
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	4
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 128 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break
	case 111
	case 112
	setvar xweapon	182
	setvar yweapon	153
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 128 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 113
	case 114
	case 115
	setvar xweapon	184
	setvar yweapon	154
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 128 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break	
	case 116
	case 117
	setvar xweapon	187
	setvar yweapon	155
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	4
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 168 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 118
	case 119
	case 120
	setvar xweapon	185
	setvar yweapon	152
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 168 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 121
	case 122
	case 123
	setvar xweapon	186
	setvar yweapon	154
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 168 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 124
	case 125
	setvar xweapon	188
	setvar yweapon	157
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	4
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 168 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 126
	case 127
	case 128
	setvar xweapon	184
	setvar yweapon	159
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64	
	ifvare invisible 1 {  rotatesprite xweapon yweapon 65536 168 tilenumweapon -128 palweapon 37 0 0 xdim ydim	} else  rotatesprite xweapon yweapon 65536 168 tilenumweapon -128 palweapon 4 0 0 xdim ydim
	break		
	case 129 //56
	case 130
	case 131
	setvar xweapon	188
	setvar yweapon	156
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 168 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	187
	setvar yweapon	164
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 45875 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	199
	setvar yweapon	156
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 41943 384 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 132
	case 133
	case 134
	setvar xweapon	189
	setvar yweapon	159
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	4
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 168 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim
	setvar xweapon	188
	setvar yweapon	166
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 45875 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	198
	setvar yweapon	153
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	4
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 384 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim		
	break		
	case 135
	case 136
	case 137
	setvar xweapon	188
	setvar yweapon	154
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 168 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	187
	setvar yweapon	167
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	4
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	195
	setvar yweapon	152
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64	
	ifvare invisible 1 { rotatesprite xweapon yweapon 65536 384 tilenumweapon -128 palweapon 37 0 0 xdim ydim } else rotatesprite xweapon yweapon 65536 384 tilenumweapon -128 palweapon 4 0 0 xdim ydim 	
	break		
	case 138
	case 139
	case 140
	setvar xweapon	188
	setvar yweapon	156
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 168 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	183
	setvar yweapon	169
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64	
	ifvare invisible 1 { rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon 37 0 0 xdim ydim	} else rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon 4 0 0 xdim ydim
	setvar xweapon	199
	setvar yweapon	154
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	4
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 384 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break	
	case 141
	case 142
	setvar xweapon	191
	setvar yweapon	159
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	4
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 168 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim
	setvar xweapon	183
	setvar yweapon	167
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	203
	setvar yweapon	149
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 384 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim		
	break		
	case 143
	case 144
	case 145
	setvar xweapon	190
	setvar yweapon	155
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 168 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	185
	setvar yweapon	169
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	4
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	202
	setvar yweapon	151
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 384 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 146
	case 147
	setvar xweapon	190
	setvar yweapon	157
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 168 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	182
	setvar yweapon	166
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	205
	setvar yweapon	148
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 384 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 148
	case 149
	case 150
	setvar xweapon	192
	setvar yweapon	160
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	4
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 168 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	183
	setvar yweapon	170
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	205
	setvar yweapon	152
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	4
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 384 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case 151
	case 152
	case 153
	setvar xweapon	192
	setvar yweapon	156
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 168 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	184
	setvar yweapon	169
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	4
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 128 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	201
	setvar yweapon	151
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64	
	ifvare invisible 1 { rotatesprite xweapon yweapon 65536 384 tilenumweapon -128 palweapon 37 0 0 xdim ydim } else rotatesprite xweapon yweapon 65536 384 tilenumweapon -128 palweapon 4 0 0 xdim ydim
	break		
	case 154
	case 155
	case 156
	setvar xweapon	192
	setvar yweapon	159
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 168 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	183
	setvar yweapon	170
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64	
	ifvare invisible 1 { rotatesprite xweapon yweapon 65536 128 tilenumweapon -128 palweapon 37 0 0 xdim ydim } else rotatesprite xweapon yweapon 65536 128 tilenumweapon -128 palweapon 4 0 0 xdim ydim 
	setvar xweapon	203
	setvar yweapon	152
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 384 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break	
	endswitch
ends

state tntaltfire
 switch tntalt	
	case 1
	case 2
	case 3
	setvar xweapon	213
	setvar yweapon	184
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 64
	setvar orientationweapon 0
	ifvare invisible 1 orvar orientationweapon 33
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	161
	setvar yweapon	135
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	2
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim
	setvar xweapon	110
	setvar yweapon	177
	setvar tilenumweapon	LIGHTER
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	addvar tilenumweapon 7
	addvar xweapon 34
	addvar yweapon -50	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim
	break			
	case 4
	case 5
	setvar xweapon	213
	setvar yweapon	184
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	161
	setvar yweapon	135
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	2
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	110
	setvar yweapon	177
	setvar tilenumweapon	LIGHTER
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	addvar tilenumweapon 7
	addvar xweapon 34
	addvar yweapon -50	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim
	setvar xweapon	133
	setvar yweapon	123
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim
	break			
	case 6
	case 7
	setvar xweapon	219
	setvar yweapon	191
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim
	setvar xweapon	167
	setvar yweapon	142
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	2
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	104
	setvar yweapon	181
	setvar tilenumweapon	LIGHTER
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	addvar tilenumweapon 7
	addvar xweapon 34
	addvar yweapon -50	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim
	setvar xweapon	142
	setvar yweapon	131
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break			
	case 8
	case 9
	setvar xweapon	231
	setvar yweapon	202
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	179
	setvar yweapon	153
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	2
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	97
	setvar yweapon	192
	setvar tilenumweapon	LIGHTER
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	addvar tilenumweapon 7
	addvar xweapon 34
	addvar yweapon -50	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim
	setvar xweapon	158
	setvar yweapon	143
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	4
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break			
	case 10
	case 11
	setvar xweapon	245
	setvar yweapon	215
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	193
	setvar yweapon	166
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	2
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	85
	setvar yweapon	204
	setvar tilenumweapon	LIGHTER
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	addvar tilenumweapon 7
	addvar xweapon 34
	addvar yweapon -50	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim
	setvar xweapon	169
	setvar yweapon	155
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break	
    case 12
    case 13
    case 14
	setvar xweapon	245
	setvar yweapon	215
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim
	setvar xweapon	193
	setvar yweapon	166
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	2
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	85
	setvar yweapon	204
	setvar tilenumweapon	LIGHTER
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	addvar tilenumweapon 7
	addvar xweapon 34
	addvar yweapon -50	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim
	setvar xweapon	169
	setvar yweapon	155

	state bunfuse
	
    break
 endswitch
ends


state dynamitedisplay
ifvarn tntalt 0 { state tntaltfire break }
 switch player[THISACTOR].kickback_pic
	case	0 //BUNFUSE.QAV
	setvar xweapon	224
	setvar yweapon	182
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 64
	setvar orientationweapon 0
	ifvare invisible 1 orvar orientationweapon 33
	ifvarg yweapon 320 setvar yweapon 320
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim
	setvar xweapon	172
	setvar yweapon	133
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	2
	state hudcoordfix addvar yweapon 64
	ifvarg yweapon 320 setvar yweapon 320
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim		
	break		
	case 1
	case 2
	case 3
	setvar xweapon	213
	setvar yweapon	184
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	161
	setvar yweapon	135
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	2
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim
	setvar xweapon	110
	setvar yweapon	177
	setvar tilenumweapon	LIGHTER
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	addvar tilenumweapon 7
	addvar xweapon 34
	addvar yweapon -50	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim
	break			
	case 4
	case 5
	setvar xweapon	213
	setvar yweapon	184
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	161
	setvar yweapon	135
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	2
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	110
	setvar yweapon	177
	setvar tilenumweapon	LIGHTER
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	addvar tilenumweapon 7
	addvar xweapon 34
	addvar yweapon -50	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim
	setvar xweapon	133
	setvar yweapon	123
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim
	break			
	case 6
	case 7
	setvar xweapon	219
	setvar yweapon	191
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim
	setvar xweapon	167
	setvar yweapon	142
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	2
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	104
	setvar yweapon	181
	setvar tilenumweapon	LIGHTER
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	addvar tilenumweapon 7
	addvar xweapon 34
	addvar yweapon -50	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim
	setvar xweapon	142
	setvar yweapon	131
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break			
	case 8
	case 9
	setvar xweapon	231
	setvar yweapon	202
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	179
	setvar yweapon	153
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	2
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	97
	setvar yweapon	192
	setvar tilenumweapon	LIGHTER
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	addvar tilenumweapon 7
	addvar xweapon 34
	addvar yweapon -50	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim
	setvar xweapon	158
	setvar yweapon	143
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	4
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break			
	case 10
	case 11
	setvar xweapon	245
	setvar yweapon	215
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	193
	setvar yweapon	166
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	2
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	85
	setvar yweapon	204
	setvar tilenumweapon	LIGHTER
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	addvar tilenumweapon 7
	addvar xweapon 34
	addvar yweapon -50	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim
	setvar xweapon	169
	setvar yweapon	155
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break	
    case 12
    case 13
    case 14
	setvar xweapon	245
	setvar yweapon	215
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim
	setvar xweapon	193
	setvar yweapon	166
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	2
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	85
	setvar yweapon	204
	setvar tilenumweapon	LIGHTER
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	addvar tilenumweapon 7
	addvar xweapon 34
	addvar yweapon -50	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim
	setvar xweapon	169
	setvar yweapon	155

	state bunfuse
	
    break
	case 15 //BUNTHRO.QAV
	case 16
	setvar xweapon	256
	setvar yweapon	236
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	204
	setvar yweapon	187
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	2
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	188
	setvar yweapon	178
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	81
	setvar yweapon	208
	setvar tilenumweapon	LIGHTER
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim
	addvar tilenumweapon 7
	addvar xweapon 34
	addvar yweapon -50	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case	17
	setvar xweapon	74
	setvar yweapon	211
	setvar tilenumweapon	LIGHTER
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	addvar tilenumweapon 7
	addvar xweapon 34
	addvar yweapon -50	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break			
	case	18
	setvar xweapon	63
	setvar yweapon	214
	setvar tilenumweapon	LIGHTER
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	addvar tilenumweapon 7
	addvar xweapon 34
	addvar yweapon -50	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break			
	case	19
	setvar xweapon	52
	setvar yweapon	217
	setvar tilenumweapon	LIGHTER
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	addvar tilenumweapon 7
	addvar xweapon 34
	addvar yweapon -50	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case	20
	setvar xweapon	274
	setvar yweapon	221
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	33
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	44
	setvar yweapon	220
	setvar tilenumweapon	LIGHTER
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	addvar tilenumweapon 7
	addvar xweapon 34
	addvar yweapon -50	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case	21
	setvar xweapon	262
	setvar yweapon	197
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	33
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	37
	setvar yweapon	221
	setvar tilenumweapon	LIGHTER
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	addvar tilenumweapon 7
	addvar xweapon 34
	addvar yweapon -50	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case	22
	setvar xweapon	252
	setvar yweapon	166
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	34
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	32
	setvar yweapon	222
	setvar tilenumweapon	LIGHTER
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	addvar tilenumweapon 7
	addvar xweapon 34
	addvar yweapon -50	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case	23
	setvar xweapon	250
	setvar yweapon	164
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	34
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim
	setvar xweapon	26
	setvar yweapon	220
	setvar tilenumweapon	LIGHTER
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	addvar tilenumweapon 7
	addvar xweapon 34
	addvar yweapon -50	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case	24
	setvar xweapon	247
	setvar yweapon	197
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	34
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	33
	setvar yweapon	210
	setvar tilenumweapon	LIGHTER
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	addvar tilenumweapon 7
	addvar xweapon 34
	addvar yweapon -50	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break		
	case	25
	setvar xweapon	252
	setvar yweapon	211
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	34
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	60
	setvar yweapon	193
	setvar tilenumweapon	LIGHTER
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	addvar tilenumweapon 7
	addvar xweapon 34
	addvar yweapon -50	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break	
	case	26
	setvar xweapon	249
	setvar yweapon	224
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	33
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	setvar xweapon	79
	setvar yweapon	185
	setvar tilenumweapon	LIGHTER
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	addvar tilenumweapon 7
	addvar xweapon 34
	addvar yweapon -50	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break	
	case 27 
	setvar xweapon	110
	setvar yweapon	177
	setvar tilenumweapon	LIGHTER
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	addvar tilenumweapon 7
	addvar xweapon 34
	addvar yweapon -50	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break
	
	case 28 //BUNDROP.QAV case 0
	setvar xweapon	245
	setvar yweapon	215
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	
	setvar xweapon	193
	setvar yweapon	166
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	2
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	
	setvar xweapon	181
	setvar yweapon	158
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	

	setvar xweapon	81
	setvar yweapon	208
	setvar tilenumweapon	LIGHTER
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	addvar tilenumweapon 7
	addvar xweapon 34
	addvar yweapon -50	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break	
			
	case	29
	setvar xweapon	238
	setvar yweapon	222
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 1972 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	
	setvar xweapon	177
	setvar yweapon	187
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	2
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 1968 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim

	setvar xweapon	169
	setvar yweapon	180
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	4
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	
	setvar xweapon	74
	setvar yweapon	211
	setvar tilenumweapon	LIGHTER
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	addvar tilenumweapon 7
	addvar xweapon 34
	addvar yweapon -50	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break	
			
	case	30
	setvar xweapon	231
	setvar yweapon	229
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 1920 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim
	
	setvar xweapon	166
	setvar yweapon	203
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	2
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 1920 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	

	setvar xweapon	156
	setvar yweapon	195
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	5
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	

	setvar xweapon	67
	setvar yweapon	204
	setvar tilenumweapon	LIGHTER
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	addvar tilenumweapon 7
	addvar xweapon 34
	addvar yweapon -50	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break	
	case	31
	setvar xweapon	79
	setvar yweapon	193
	setvar tilenumweapon	LIGHTER
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	addvar tilenumweapon 7
	addvar xweapon 34
	addvar yweapon -50	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break			
	case	32
	setvar xweapon	101
	setvar yweapon	179
	setvar tilenumweapon	LIGHTER
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	addvar tilenumweapon 7
	addvar xweapon 34
	addvar yweapon -50	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break			
	case	33
	setvar xweapon	110
	setvar yweapon	177
	setvar tilenumweapon	LIGHTER
	addvar tilenumweapon	3
	state hudcoordfix addvar yweapon 64	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	addvar tilenumweapon 7
	addvar xweapon 34
	addvar yweapon -50	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	break	

 endswitch
ends

state proximityminedisplay
 switch player[THISACTOR].kickback_pic
    case 0
    case 1
    case 2
    case 3
    case 4
    setvar xweapon 210
    setvar yweapon 250
	state hudcoordfix
    setvar tilenumweapon DYNAMITE
    addvar tilenumweapon 0
	setvar orientationweapon 0
	ifvare invisible 1 orvar orientationweapon 33
    myospal xweapon yweapon tilenumweapon shade orientationweapon palweapon
		ifvarl player[THISACTOR].kickback_pic 5
		{
		 setvar xweapon 176
   		 setvar yweapon 218
		 state hudcoordfix
   		 setvar tilenumweapon DYNAMITE
   		 addvar tilenumweapon 6
   		 myospal xweapon yweapon tilenumweapon shade orientationweapon palweapon
 		 addvar tilenumweapon 1	
		 addvar yweapon 12
		 addvar xweapon 1
         myospal xweapon yweapon tilenumweapon 0 orientationweapon palweapon
		}
    break
	case	5
	setvar xweapon	226
	setvar yweapon	188
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim

	setvar xweapon	192
	setvar yweapon	156
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	6
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	
	setvar xweapon	193
	setvar yweapon	168
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	9
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	
	break	
	
	case	6
	setvar xweapon	231
	setvar yweapon	196
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	
	setvar xweapon	197
	setvar yweapon	164
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	6
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	

	setvar xweapon	198
	setvar yweapon	176
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	10
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	

	break
	
	case	7
	setvar xweapon	245
	setvar yweapon	219
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	
	setvar xweapon	211
	setvar yweapon	187
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	6
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	

	setvar xweapon	212
	setvar yweapon	199
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	-8
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	

	break
	
	case	8
	setvar xweapon	259
	setvar yweapon	243
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	break	
	
	case	10
	setvar xweapon	274
	setvar yweapon	221
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	33
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	break
	
	case	11
	setvar xweapon	262
	setvar yweapon	197
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	33
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	break	
		
	case	12
	setvar xweapon	252
	setvar yweapon	166
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	34
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	break	
		
	case	13
	setvar xweapon	250
	setvar yweapon	164
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	34
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	break	
		
	case	14
	setvar xweapon	247
	setvar yweapon	197
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	34
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	break		
		
	case	15
	setvar xweapon	247
	setvar yweapon	197
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	34
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	break		
		
	case	16
	setvar xweapon	237
	setvar yweapon	224
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	33
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 0 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	break

	case	17 //PROXDROP.QAV
	setvar xweapon	226
	setvar yweapon	188
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 1996 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim

	setvar xweapon	188
	setvar yweapon	162
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	6
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 1996 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim

	setvar xweapon	191
	setvar yweapon	174
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	7
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 1996 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	
	break	
		
	case	18
	setvar xweapon	231
	setvar yweapon	196
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 1920 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim

	setvar xweapon	188
	setvar yweapon	180
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	6
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 1920 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	
	setvar xweapon	193
	setvar yweapon	191
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	8
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 1920 tilenumweapon -128 palweapon orientationweapon 0 0 xdim ydim	
	
	break	
		
	case	19
	setvar xweapon	245
	setvar yweapon	219
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	0
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 1872 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	
	
	setvar xweapon	200
	setvar yweapon	209
	setvar tilenumweapon	DYNAMITE
	addvar tilenumweapon	6
	state hudcoordfix addvar yweapon 80	
	rotatesprite xweapon yweapon 65536 1872 tilenumweapon shade palweapon orientationweapon 0 0 xdim ydim	

	break	

  endswitch
ends

state dynamitepressedfire
ifvare CURRWEAP 5
ifp palive
{
	ifinwater {
	    ifvare WEAPON_VAR_TNT 1 {
		setplayer[THISACTOR].kickback_pic 0
		setvar TNTCOUNT 0 }
		ifvarg WEAPON_VAR_TNT 1
		{
			ifvare player[THISACTOR].kickback_pic 4
			ifvarl TNTCOUNT 64 { addvar TNTCOUNT 1 }
		}
		ifvare WEAPON_VAR_TNT 3
		ifvare player[THISACTOR].kickback_pic 20
		{ setvar detonator_on 1	}
	} else
	{
		ifvare WEAPON_VAR_TNT 1
		{
			ifvare player[THISACTOR].weapon_pos 0 ifvarg player[THISACTOR].kickback_pic 0 ifvarl player[THISACTOR].kickback_pic 15 ifvarl TNTCOUNT 64 { addvar TNTCOUNT 1 }
			ifvarn tntalt 0 { setvar tntalt 0 setvar TNTFLOORALT 1 setplayer[THISACTOR].kickback_pic 14 }
		}
		ifvarg WEAPON_VAR_TNT 1
		{
			ifvare player[THISACTOR].kickback_pic 4
			ifvarl TNTCOUNT 64 { addvar TNTCOUNT 1 }
		}
		ifvare WEAPON_VAR_TNT 3
		ifvare player[THISACTOR].kickback_pic 20
		{ setvar detonator_on 1	}
	}
}
ends

state dynamitestate
ifvare player[THISACTOR].curr_weapon 5 setvarvar currdinamite WEAPON_VAR_TNT else { setvar currdinamite 0 }
ifinwater { 
stopsound TNTFUSE 
setvar dtime 0 
	ifvare WEAPON_VAR_TNT 1 {
		setvar SHOOTTNT 0 
		setvar TNTCOUNT 0
	}
}
ifvarn detonateplayer 0
{
	addvar detonateplayer 1
	ifvarg detonateplayer 14 setvar detonateplayer 0
}
ifvare CURRWEAP 10 //появляется если остается последний remotetnt
ifvarg player[THISACTOR].kickback_pic 7
{
	ifvarg PROXIMITYMINE_AMMOAMOUNT 0 { setplayer[THISACTOR].ammo_amount 5 PROXIMITYMINE_AMMOAMOUNT setvar changeweappos 2 setplayer[THISACTOR].weapon_pos -1 } else
	ifvarg TNT_AMMOAMOUNT 0 { setplayer[THISACTOR].ammo_amount 5 TNT_AMMOAMOUNT setvar changeweappos 1 setplayer[THISACTOR].weapon_pos -1 }
	setvar detonat_fire 0
}

ifvarn tntalt 0
{
	setplayer[THISACTOR].curr_weapon 5
	setplayer[THISACTOR].weapon_pos 0
	addvar tntalt 1
	ifvarg tntalt 14 setvar tntalt 14
}

	ifvare SHOOTTNT 1 
	{ 
	getprojectile[TNTBUNDLE].vel tmp
	mulvar TNTCOUNT 10
	addvarvar tmp TNTCOUNT
	setprojectile[TNTBUNDLE].vel tmp

	eshoot TNTBUNDLE
	setactorvar[RETURN].detonatetime dtime
	getactor[RETURN].zvel zvel
	mulvar TNTCOUNT -11
	addvarvar zvel TNTCOUNT
	setactor[RETURN].zvel zvel
	subvar TNT_AMMOAMOUNT 1
	setvar SHOOTTNT 0 
	setvar TNTCOUNT 0
	setvar dtime 0
	setprojectile[TNTBUNDLE].vel 256
	}

	ifvare SHOOTTNT 2
	{ 
	getprojectile[PROXIMITYBUNDLE].vel tmp
	mulvar TNTCOUNT 10
	addvarvar tmp TNTCOUNT
	setprojectile[PROXIMITYBUNDLE].vel tmp

	eshoot PROXIMITYBUNDLE
	getactor[RETURN].zvel zvel
	mulvar TNTCOUNT -11
	addvarvar zvel TNTCOUNT
	setactor[RETURN].zvel zvel
	subvar PROXIMITYMINE_AMMOAMOUNT 1
	setvar SHOOTTNT 0 
	setvar TNTCOUNT 0
	setprojectile[PROXIMITYBUNDLE].vel 256
	}

	ifvare SHOOTTNT 3 
	{ 
	setvar temp 0
	whilevarvarn temp m_playernumber
	{
		getplayer[temp].i pid
		ifvarvare pid THISACTOR setvarvar perplayer temp
		addvar temp 1
	}

	getprojectile[REMOTEBUNDLE].vel tmp
	mulvar TNTCOUNT 10
	addvarvar tmp TNTCOUNT
	setprojectile[REMOTEBUNDLE].vel tmp

	eshoot REMOTEBUNDLE
	setactorvar[RETURN].remoteplayer perplayer
	getactor[RETURN].zvel zvel
	mulvar TNTCOUNT -11
	addvarvar zvel TNTCOUNT
	setactor[RETURN].zvel zvel
	subvar REMOTETNT_AMMOAMOUNT 1
	setvar SHOOTTNT 0 
	setvar TNTCOUNT 0
	setprojectile[REMOTEBUNDLE].vel 256
	}
	
ifvare CURRWEAP 5
{
ifvare WEAPON_VAR_TNT 1 { setplayer[THISACTOR].ammo_amount 5 TNT_AMMOAMOUNT }
ifvare WEAPON_VAR_TNT 2 { setplayer[THISACTOR].ammo_amount 5 PROXIMITYMINE_AMMOAMOUNT }
ifvare WEAPON_VAR_TNT 3 { setplayer[THISACTOR].ammo_amount 5 REMOTETNT_AMMOAMOUNT }

getplayer[THISACTOR].kickback_pic tmp
ifvare tmp 15 { soundonce TNTTOSS }

ifvare player[THISACTOR].ammo_amount 5 0
ifvare player[THISACTOR].kickback_pic 0
{
	ifvare TNT_AMMOAMOUNT 0 ifvare REMOTETNT_AMMOAMOUNT 0 ifvare PROXIMITYMINE_AMMOAMOUNT 0 { setvar LIGHTERENABLE 0 setplayer[THISACTOR].weapon_pos 10 setvar changeweappos 5 } else
	ifvarn WEAPON_VAR_TNT 3
	{
		ifrnd 85 { ifvarg TNT_AMMOAMOUNT 0 { setplayer[THISACTOR].ammo_amount 5 TNT_AMMOAMOUNT setvar changeweappos 1 setplayer[THISACTOR].weapon_pos 10 } } else
		ifrnd 85 { ifvarg REMOTETNT_AMMOAMOUNT 0 { setplayer[THISACTOR].ammo_amount 5 REMOTETNT_AMMOAMOUNT setvar changeweappos 3 setplayer[THISACTOR].weapon_pos 10 } } else
		ifvarg PROXIMITYMINE_AMMOAMOUNT 0 { setplayer[THISACTOR].ammo_amount 5 PROXIMITYMINE_AMMOAMOUNT setvar changeweappos 2 setplayer[THISACTOR].weapon_pos 10 }
	}
}

ifvare WEAPON_VAR_TNT 1
{
	setvar WEAPON5_FIREDELAY 14
	setvar WEAPON5_TOTALTIME 33
	setvar WEAPON5_HOLDDELAY 21
	ifinwater { setplayer[THISACTOR].weapon_pos 20 setvar LIGHTERENABLE 0 setvar tntalt 0 } 
} 
else ifvare WEAPON_VAR_TNT 2
{
	setvar WEAPON5_FIREDELAY 4
	setvar WEAPON5_TOTALTIME 20
	setvar WEAPON5_HOLDDELAY 12
}
else ifvare WEAPON_VAR_TNT 3
{
	setvar WEAPON5_FIREDELAY 4
	setvar WEAPON5_TOTALTIME 45
	setvar WEAPON5_HOLDDELAY 12
}
	ifvare tntalt 14
	{
	addvar dtime 1 soundonce TNTFUSE
	ifvarg dtime 156
			{
			setplayer[THISACTOR].kickback_pic 0
			setplayer[THISACTOR].weapon_pos 20
			palfrom 32 32
			setvar detonateplayer 1
			globalsound EXPLODCM
			espawn EXPLOSION3
	    	getactor[THISACTOR].x x
	    	getactor[THISACTOR].y y
	    	getplayer[THISACTOR].ang tmp
	    	setvarvar x2 x
	    	addvar x2 512
	    	rotatepoint x y x2 y tmp x3 y3
	    	setactor[RETURN].x x3
	    	setactor[RETURN].y y3
			hitradius 2048 60 100 160 300

			getplayer[THISACTOR].ang ang
			addvar ang 1024
			setactor[THISACTOR].htang ang
			setactor[THISACTOR].htextra 150
			setvarvar k_damage 25
			getplayer[THISACTOR].ammo_amount 5 tmp
			ifvarg tmp 0 subvar tmp 1
			setplayer[THISACTOR].ammo_amount 5 tmp
			setvar dtime 0
			setvar tntalt 0
			}
	}
	getplayer[THISACTOR].kickback_pic tmp
	ifvare tmp 14
	ifvare WEAPON_VAR_TNT 1
	{
	addvar dtime 1 soundonce TNTFUSE
	ifvarg dtime 156
			{
			setplayer[THISACTOR].kickback_pic 0
			setplayer[THISACTOR].weapon_pos 20
			palfrom 32 32
			setvar detonateplayer 1
			globalsound EXPLODCM
			espawn EXPLOSION3
	    	getactor[THISACTOR].x x
	    	getactor[THISACTOR].y y
	    	getplayer[THISACTOR].ang tmp
	    	setvarvar x2 x
	    	addvar x2 512
	    	rotatepoint x y x2 y tmp x3 y3
	    	setactor[RETURN].x x3
	    	setactor[RETURN].y y3
			hitradius 2048 60 100 160 300

			getplayer[THISACTOR].ang ang
			addvar ang 1024
			setactor[THISACTOR].htang ang
			setactor[THISACTOR].htextra 150
			setvarvar k_damage 25
			getplayer[THISACTOR].ammo_amount 5 tmp
			ifvarg tmp 0 subvar tmp 1
			setplayer[THISACTOR].ammo_amount 5 tmp
			setvar dtime 0
			setvar tntalt 0
			}
	}
	ifvare dtime 0 { stopsound TNTFUSE }
}

ifvare CURRWEAP 5
ifp palive
{
	ifvare WEAPON_VAR_TNT 3
	{
		getplayer[THISACTOR].kickback_pic perplayer
		ifvare perplayer 0 ifvarg REMOTETNT_AMMOAMOUNT 0 ifvare player[THISACTOR].weapon_pos 10 setvar detonat_fire 0 // переменная для скрытия связки динамита, когда переключаешься на другое оружие после броска динамита
		ifvarg perplayer 20 ifvarl perplayer 22 { 
			
			
		
		
			ifvarn detonator_on 1 { 
				ifvare hbomb_reset 0 {
					setvar detonat_fire 1 
					setplayer[THISACTOR].kickback_pic 20 
				} else {
					setvar detonat_fire 0
					setplayer[THISACTOR].kickback_pic 30
					setvar hbomb_reset 0
				}
			}  else { setvar detonator_on 0 setplayer[THISACTOR].kickback_pic 22 } //нажатие на кнопку
		}
		ifvare perplayer 28 { soundonce REMFIRE setvar detonat_fire 0 setplayer[THISACTOR].hbomb_on 0 }
		ifvare perplayer 35 
		{ setplayer[THISACTOR].kickback_pic 0 }
		ifvarg perplayer 31 ifvarl perplayer 33 
		ifvare REMOTETNT_AMMOAMOUNT 0
		{
			ifvare TNT_AMMOAMOUNT 0 ifvare REMOTETNT_AMMOAMOUNT 0 ifvare PROXIMITYMINE_AMMOAMOUNT 0 { setvar LIGHTERENABLE 0 setplayer[THISACTOR].weapon_pos 10 setvar changeweappos 5 } else
			{
				ifvarg PROXIMITYMINE_AMMOAMOUNT 0 { setplayer[THISACTOR].ammo_amount 5 PROXIMITYMINE_AMMOAMOUNT setplayer[THISACTOR].kickback_pic 0 setvar changeweappos 2 setplayer[THISACTOR].weapon_pos 10 } else
				{ ifvarg TNT_AMMOAMOUNT 0 { setplayer[THISACTOR].ammo_amount 5 TNT_AMMOAMOUNT setplayer[THISACTOR].kickback_pic 0 setvar changeweappos 1 setplayer[THISACTOR].weapon_pos 10 } }
			}
		}
		ifvare perplayer 40 setplayer[THISACTOR].kickback_pic 20
	}
	ifvare WEAPON_VAR_TNT 2
	{	
		getplayer[THISACTOR].kickback_pic perplayer
		ifvare perplayer 16 { setplayer[THISACTOR].kickback_pic 0 setplayer[THISACTOR].weapon_pos 10 }
	}
	ifvare WEAPON_VAR_TNT 1
	{	
		getplayer[THISACTOR].kickback_pic perplayer
		ifvare perplayer 27 { setplayer[THISACTOR].kickback_pic 0 setplayer[THISACTOR].weapon_pos 10 }
	}
}

ifvare CURRWEAP 6 ifvare LIGHTERENABLE 0 { ifvare player[THISACTOR].weapon_pos 4 soundonce ZIPCLOSE ifvare player[THISACTOR].weapon_pos 2 { setvar lighteron 1 soundonce ZIPLIGHT } }
ifvare CURRWEAP 5 ifvare LIGHTERENABLE 0 ifvare WEAPON_VAR_TNT 1 { ifvare player[THISACTOR].weapon_pos 4 soundonce ZIPCLOSE ifvare player[THISACTOR].weapon_pos 2 { setvar lighteron 1 soundonce ZIPLIGHT } } 
ifvare player[THISACTOR].weapon_pos -2
{ 
   ifvarn CURRWEAP 6 ifvarn CURRWEAP 5 ifvarn currdinamite 1 ifvare LIGHTERENABLE 1 { sound ZIPCLOSE setvar LIGHTERENABLE 0 }
   ifvare buttonnum 1 ifvare lighteron 1 ifvare LIGHTERENABLE 0 { sound ZIPCLOSE setvar buttonnum 0 setvar lighteron 0 }   
}
ifvarn CURRWEAP 5 ifvarn CURRWEAP 6 { setvar lighteron 0 setvar TNTCOUNT 0 }
ends

onevent EVENT_WEAPKEY6
ifvarn CURRWEAP 6 { setvar LIGHTERENABLE 0 } else ifvarn WEAPON_VAR_TNT 1 { setvar LIGHTERENABLE 0 } setvar buttonnum 1
ifinwater { ifvare REMOTETNT_AMMOAMOUNT 0 ifvare PROXIMITYMINE_AMMOAMOUNT 0 setvar RETURN -1 else ifvare WEAPON_VAR_TNT 1 setvar WEAPON_VAR_TNT 2 }

ifvare CURRWEAP 5
{
	ifvare player[THISACTOR].kickback_pic 0
	ifvare player[THISACTOR].weapon_pos 0
	ifvarg player[THISACTOR].gotweapon 5 0
	ifvare tntalt 0
	{  
		   ifvare WEAPON_VAR_TNT 1
		   {
			 ifvarg PROXIMITYMINE_AMMOAMOUNT 0 
			 { setvar changeweappos 2 setplayer[THISACTOR].weapon_pos -1 } else ifvarg REMOTETNT_AMMOAMOUNT 0 { setvar changeweappos 3 setplayer[THISACTOR].weapon_pos -1 }
		   }
		   else ifvare WEAPON_VAR_TNT 2
		   {
			 ifvarg REMOTETNT_AMMOAMOUNT 0 { setvar changeweappos 3 setplayer[THISACTOR].weapon_pos -1 } else ifvarg TNT_AMMOAMOUNT 0 { setvar changeweappos 1 setplayer[THISACTOR].weapon_pos -1 }
		   }
		   else ifvare WEAPON_VAR_TNT 3
		   {
			 ifvarg TNT_AMMOAMOUNT 0 { ifinwater { ifvarg PROXIMITYMINE_AMMOAMOUNT 0 { setvar changeweappos 2 setplayer[THISACTOR].weapon_pos -1 } } else { setvar changeweappos 1 setplayer[THISACTOR].weapon_pos -1 } } else ifvarg PROXIMITYMINE_AMMOAMOUNT 0 { setvar changeweappos 2 setplayer[THISACTOR].weapon_pos -1 }
		   }
		   
	} else
	ifvare WEAPON_VAR_TNT 3
	ifvare player[THISACTOR].kickback_pic 20
	{
		setplayer[THISACTOR].kickback_pic 0
		ifvarg TNT_AMMOAMOUNT 0 { ifinwater { ifvarg PROXIMITYMINE_AMMOAMOUNT 0 { setvar changeweappos 2 setplayer[THISACTOR].weapon_pos -1 } } else { setvar changeweappos 1 setplayer[THISACTOR].weapon_pos -1 } } else ifvarg PROXIMITYMINE_AMMOAMOUNT 0 { setvar changeweappos 2 setplayer[THISACTOR].weapon_pos -1 }
	}
}
endevent









