
state projectile_anim
	ifactor BUCHERFLYAXE
	{
		getplayer[THISACTOR].i PLAYERID
		getactor[THISACTOR].ang ang
		getactor[PLAYERID].ang pang
		getincangle pang pang ang
		ifvarl pang 0 mulvar pang -1
		ifvarg pang 384 ifvarl pang 896 { action AXEFRAME1 } else { action AXEFRAME2 }
		ifcount 2 { cstat 2 } ifcount 4 { cstat 514 } ifcount 5 killit
	}	
	ifactor PHANTOMSKULL
	{
		addvar COUNTER 1
		ifvare COUNTER 4
		{
			setvar COUNTER 0
			ifaction FRAME1 action FRAME2 else
			ifaction FRAME2 action FRAME3 else
			ifaction FRAME3 action FRAME4 else 
			ifaction FRAME4 action FRAME1
		}
	}
	ifactor BUCHERSLIME
	{
		addvar COUNTER 1
		ifvare COUNTER 5
		{
			setvar COUNTER 0
			ifaction FRAME1 action FRAME2 else
			ifaction FRAME2 action FRAME3 else
			ifaction FRAME3 action FRAME4 else
			ifaction FRAME4 action FRAME5 else
			ifaction FRAME5 action FRAME1
		}
	}
	ifactor TNTBUNDLE2
	{
		addvar COUNTER 1
		ifvare COUNTER 2
		{
			setvar COUNTER 0
			ifaction FRAME_FRAME1 action FRAME_FRAME2 else
			ifaction FRAME_FRAME2 action FRAME_FRAME3 else
			ifaction FRAME_FRAME3 action FRAME_FRAME4 else
			ifaction FRAME_FRAME4 action FRAME_FRAME5 else
			ifaction FRAME_FRAME5 action FRAME_FRAME6 else
			ifaction FRAME_FRAME6 action FRAME_FRAME1 
		}
	}

	ifactor NEWSCRAP1
	{
		addvar COUNTER 1
		ifvare COUNTER 2
		{
			setvar COUNTER 0
			ifaction FRAME_FRAME1 action FRAME_FRAME2 else
			ifaction FRAME_FRAME2 action FRAME_FRAME3 else
			ifaction FRAME_FRAME3 action FRAME_FRAME4 else
			ifaction FRAME_FRAME4 action FRAME_FRAME5 else
			ifaction FRAME_FRAME5 killit
		}
		
		ifspawnedby STAFFALTPROJ
		{
			setactor[THISACTOR].pal 10
		}
	}
	ifactor GUNFIRE
	{
		getactorvar[THISACTOR].fire_dist fire_dist
		ifvare peractor 0
		{
			ifrnd 128 { cstator 4 }
			setvar peractor 1
		}
		addvar COUNTER 1
		
		setvarvar gun_count fire_dist
		mulvarvar gun_count 2
		divvar gun_count 10
		ifvarl gun_count 2 setvar gun_count 2
		ifvarvare COUNTER gun_count
		{
			addvar FIRECOUNT 1
			ifaction FRAMEMINUS7 { setvarvar gun_xvel 15 mulvarvar gun_xvel fire_dist setactor[THISACTOR].xvel gun_xvel action FRAMEMINUS6 } else
			ifaction FRAMEMINUS6 { setvarvar gun_xvel 25 mulvarvar gun_xvel fire_dist setactor[THISACTOR].xvel gun_xvel action FRAMEMINUS5 } else
			ifaction FRAMEMINUS5 { setvarvar gun_xvel 25 mulvarvar gun_xvel fire_dist setactor[THISACTOR].zvel -750 setactor[THISACTOR].xvel gun_xvel action FRAMEMINUS4 } else
			ifaction FRAMEMINUS4 { setvarvar gun_xvel 19 mulvarvar gun_xvel fire_dist setactor[THISACTOR].zvel -750 setactor[THISACTOR].xvel gun_xvel action FRAMEMINUS3 } else
			ifaction FRAMEMINUS3 { setvarvar gun_xvel 15 mulvarvar gun_xvel fire_dist setactor[THISACTOR].zvel -900 setactor[THISACTOR].xvel gun_xvel action FRAMEMINUS2 } else
			ifaction FRAMEMINUS2 { setvarvar gun_xvel 15 mulvarvar gun_xvel fire_dist setactor[THISACTOR].zvel -1200 setactor[THISACTOR].xvel gun_xvel action FRAMEMINUS1 } else
			ifaction FRAMEMINUS1 { setvarvar gun_xvel 15 mulvarvar gun_xvel fire_dist setactor[THISACTOR].zvel -2000 setactor[THISACTOR].xvel gun_xvel addvar fire_cnt 1 ifvare fire_cnt 2 killit }
			setvar COUNTER 0
		}
		
		ifinwater killit
		
		getactor[THISACTOR].xrepeat xrepeat
		getactor[THISACTOR].yrepeat yrepeat
				
		ifvarvarl xrepeat 24 ifvarvare peractor3 0 setvarvar peractor3 1
		ifvarvare peractor 1 { ifaction FRAMEMINUS2 setvar peractor3 2 }
				
		ifvare peractor3 1 { addvarvar xrepeat FIRECOUNT } else 
		ifvare peractor3 2 ifvarg xrepeat 4 
		{ 
			addvar fire_count 1
			ifvare fire_count  2 { subvarvar xrepeat FIRECOUNT  setvar fire_count 0 }
		} 
		ifvarl xrepeat 8 setvar xrepeat 8
		ifvarg xrepeat 32 setvar xrepeat 32
		setvarvar yrepeat xrepeat
		setactor[THISACTOR].xrepeat xrepeat
		setactor[THISACTOR].yrepeat yrepeat

	}
	ifactor HELLFLAME
	{
		addvar COUNTER 1
		ifvare COUNTER 2
		{
			setvar COUNTER 0
			ifaction HELLFLAME_FRAME1 { sizeat 8 8 action HELLFLAME_FRAME2 } else
			ifaction HELLFLAME_FRAME2 { sizeat 10 10 action HELLFLAME_FRAME3 } else
			ifaction HELLFLAME_FRAME3 { sizeat 14 14 action HELLFLAME_FRAME4 } else
			ifaction HELLFLAME_FRAME4 { sizeat 18 18 action HELLFLAME_FRAME5 } else
			ifaction HELLFLAME_FRAME5 { sizeat 22 22 action HELLFLAME_FRAME6 } else
			ifaction HELLFLAME_FRAME6 { sizeat 14 14 action HELLFLAME_FRAME7 } else
			ifaction HELLFLAME_FRAME7 { cstat 642 sizeat 10 10 action HELLFLAME_FRAME8 } else
			ifaction HELLFLAME_FRAME8 killit
		}
		ifinwater killit

	}
	ifactor NEWFIRE
	{
		ifvare peractor 0
		{
			ifrnd 128 { cstat 4 } else cstat 0
			setvar peractor 1
		}
		addvar COUNTER 1
		ifspawnedby ALTNAPALM 
		{ 
			ifvare COUNTER 2
			{
				setvar COUNTER 0
				ifaction FRAME_FRAME1 action FRAME_FRAME2 else
				ifaction FRAME_FRAME2 action FRAME_FRAME3 else
				ifaction FRAME_FRAME3 action FRAME_FRAME4 else
				ifaction FRAME_FRAME4 action FRAME_FRAME5 else
				ifaction FRAME_FRAME5 action FRAME_FRAME6 else
				ifaction FRAME_FRAME6 action FRAME_FRAME7 else
				ifaction FRAME_FRAME7 killit
			} 
			setactor[THISACTOR].xrepeat 24
			setactor[THISACTOR].yrepeat 24
		} else 
		ifspawnedby STAFFPROJ
		{ 
			ifvare COUNTER 1
			{
				setvar COUNTER 0
				ifaction FRAME_FRAME1 action FRAME_FRAME2 else
				ifaction FRAME_FRAME2 action FRAME_FRAME3 else
				ifaction FRAME_FRAME3 action FRAME_FRAME4 else
				ifaction FRAME_FRAME4 killit
			} 
			setactor[THISACTOR].xrepeat 24
			setactor[THISACTOR].yrepeat 24
		} else 
		{
			ifvare COUNTER 3
			{
				addvar FIRECOUNT 1
				setvar COUNTER 0
				ifaction FRAME_FRAME1 action FRAME_FRAME2 else
				ifaction FRAME_FRAME2 action FRAME_FRAME3 else
				ifaction FRAME_FRAME3 action FRAME_FRAME4 else
				ifaction FRAME_FRAME4 action FRAME_FRAME5 else
				ifaction FRAME_FRAME5 action FRAME_FRAME6 else
				ifaction FRAME_FRAME6 action FRAME_FRAME7 else
				ifaction FRAME_FRAME7 killit
			}
			getactor[THISACTOR].xrepeat xrepeat
			getactor[THISACTOR].yrepeat yrepeat
			getactorvar[THISACTOR].newfire_size newfire_size
			ifvarvarl xrepeat newfire_size ifvarvare peractor3 0 setvarvar peractor3 1
			ifvarvare peractor 1 { ifvarvarg xrepeat newfire_size ifaction FRAME_FRAME6 setvar peractor3 2 }
				
			ifvare peractor3 1
			{ addvarvar xrepeat FIRECOUNT } else 
			ifvare peractor3 2 { ifvarg xrepeat 4 subvarvar xrepeat FIRECOUNT }
			setvarvar yrepeat xrepeat
			setactor[THISACTOR].xrepeat xrepeat
			setactor[THISACTOR].yrepeat yrepeat
		}
		ifinwater killit

	}
	ifactor PAILMOVE { addvar COUNTER 96 ifvarg COUNTER 2048 { setvar COUNTER 0 } getprojectile[PAILMOVE].vel tmp ifvarl tmp 256 { action FRAMEMINUS1 } }
	ifactor ZOMBIEHEAD
	{
	getactor[THISACTOR].sectnum tmp
	getsector[tmp].floorshade enemyshade
	setactor[THISACTOR].shade enemyshade

	addvar COUNTER 96
	ifvarg COUNTER 2048 { setvar COUNTER 0 }
	{
	setvar in1 1
	setvar in2 SPIRALBLOOD
	state spawn_multiply
	setactorvar[RETURN].enemycount COUNTER
	}
	ifspawnedby ZOMBIE nullop else
	{ 
		{
			getactor[THISACTOR].z z
			getactor[THISACTOR].sectnum sectnum
			getsector[sectnum].floorz z2
			subvarvar z2 z
			getprojectile[ZOMBIEHEAD].vel tmp
			ifvarl tmp 256 ifvarl z2 400 { setactor[THISACTOR].zvel 0 action FRAMEMINUS1 }
			
			ifvarg z2 2500 setvar zhead_tmp 1
			ifvare zhead_tmp 1 ifvarl z2 400 { setactor[THISACTOR].zvel 0 action FRAMEMINUS1 setvar zhead_tmp 0 } 
		}
	}
}
ends