#define DEFENSE_ANIM FRAME BASEFRAME HITSOUND
	[defend]
		[frame]
			begin=-126
			end=-125
			image={BASEFRAME}
		[/frame]
		[frame]
			begin=-125
			end=-25
			image={FRAME}
		[/frame]
		[if]
			hits=hit
			[frame]
				begin=-25
				end=125
				image={FRAME}
				sound={HITSOUND}
			[/frame]
		[/if]
		[else]
			hits=miss,kill
			[frame]
				begin=-25
				end=125
				image={FRAME}
			[/frame]
		[/else]
		[frame]
			begin=125
			end=126
			image={BASEFRAME}
		[/frame]
	[/defend]
#enddef



#define DEFENSE_ANIM_FILTERED FRAME BASEFRAME HITSOUND FILTER
	[defend]
		{FILTER}
		[frame]
			begin=-126
			end=-125
			image={BASEFRAME}
		[/frame]
		[frame]
			begin=-125
			end=-25
			image={FRAME}
		[/frame]
		[if]
			hits=hit
			[frame]
				begin=-25
				end=125
				image={FRAME}
				sound={HITSOUND}
			[/frame]
		[/if]
		[else]
			hits=miss,kill
			[frame]
				begin=-25
				end=125
				image={FRAME}
			[/frame]
		[/else]
		[frame]
			begin=125
			end=126
			image={BASEFRAME}
		[/frame]
	[/defend]
#enddef


#define DEFENSE_ANIM_ELVEN_FILTERED FRAME BASEFRAME HITSOUND FILTER
	[defend]
		{FILTER}
		[frame]
			begin=-175
			end=-150
			image={BASEFRAME}
			halo=halo/elven/elven-shield-halo-20pct.png
		[/frame]
		[frame]
			begin=-150
			end=-125
			image={BASEFRAME}
			halo=halo/elven/elven-shield-halo-40pct.png
		[/frame]
		[frame]
			begin=-125
			end=-75
			image={FRAME}
			halo=halo/elven/elven-shield-halo-60pct.png
		[/frame]
		[frame]
			begin=-75
			end=-25
			image={FRAME}
			halo=halo/elven/elven-shield-halo-80pct.png
		[/frame]
		[if]
			hits=hit
			[frame]
				begin=-25
				end=75
				image={FRAME}
				sound={HITSOUND}
				halo=halo/elven/elven-shield-halo-100pct.png
			[/frame]
		[/if]
		[else]
			hits=miss,kill
			[frame]
				begin=-25
				end=75
				image={FRAME}
				halo=halo/elven/elven-shield-halo-100pct.png
			[/frame]
		[/else]
		[frame]
			begin=75
			end=125
			image={FRAME}
			halo=halo/elven/elven-shield-halo-80pct.png
		[/frame]		
		[frame]
			begin=125
			end=150
			image={BASEFRAME}
			halo=halo/elven/elven-shield-halo-60pct.png
		[/frame]
		[frame]
			begin=150
			end=175
			image={BASEFRAME}
			halo=halo/elven/elven-shield-halo-40pct.png
		[/frame]
		[frame]
			begin=175
			end=200
			image={BASEFRAME}
			halo=halo/elven/elven-shield-halo-20pct.png
		[/frame]
	[/defend]
#enddef


#define MISSILE_FRAME_WAIL
	[if]
		direction=n,ne,nw
			
		[missile_frame]
			begin=-300
			end=-230
			image="projectiles/wailprojectile-n-1.png"
			image_diagonal="projectiles/wailprojectile-ne-1.png"
		[/missile_frame]
		[missile_frame]
			begin=-230
			end=-160
			image="projectiles/wailprojectile-n-2.png"
			image_diagonal="projectiles/wailprojectile-ne-2.png"
		[/missile_frame]
		[missile_frame]
			begin=-160
			end=0
			image="projectiles/wailprojectile-n-3.png"
			image_diagonal="projectiles/wailprojectile-ne-3.png"
		[/missile_frame]
		[missile_frame]
			begin=0
			end=40
			image="projectiles/wailprojectile-n-4.png"
			image_diagonal="projectiles/wailprojectile-ne-4.png"
		[/missile_frame]
		[missile_frame]
			begin=40
			end=80
			image="projectiles/wailprojectile-n-5.png"
			image_diagonal="projectiles/wailprojectile-ne-5.png"
		[/missile_frame]
		[missile_frame]
			begin=80
			end=120
			image="projectiles/wailprojectile-n-6.png"
			image_diagonal="projectiles/wailprojectile-ne-6.png"
		[/missile_frame]
	[/if]
	[else]
		direction=s,se,sw
	### The price of asymmetrical projectiles - here, we use a conditional because the game automatically flips the images for the south frame.  We have a separate set of images for the south part, which are not only flipped vertically, but also have their angle corrected for the sw direction.
			
		[missile_frame]
			begin=-300
			end=-230
			image="projectiles/wailprojectile-s-1.png"
			image_diagonal="projectiles/wailprojectile-se-1.png"
		[/missile_frame]
		[missile_frame]
			begin=-230
			end=-160
			image="projectiles/wailprojectile-s-2.png"
			image_diagonal="projectiles/wailprojectile-se-2.png"
		[/missile_frame]
		[missile_frame]
			begin=-160
			end=0
			image="projectiles/wailprojectile-s-3.png"
			image_diagonal="projectiles/wailprojectile-se-3.png"
		[/missile_frame]
		[missile_frame]
			begin=0
			end=40
			image="projectiles/wailprojectile-s-4.png"
			image_diagonal="projectiles/wailprojectile-se-4.png"
		[/missile_frame]
		[missile_frame]
			begin=40
			end=80
			image="projectiles/wailprojectile-s-5.png"
			image_diagonal="projectiles/wailprojectile-se-5.png"
		[/missile_frame]
		[missile_frame]
			begin=80
			end=120
			image="projectiles/wailprojectile-s-6.png"
			image_diagonal="projectiles/wailprojectile-se-6.png"
		[/missile_frame]
	[/else]
#enddef

#define MISSILE_FRAME_FIRE_BREATH N_OFFSET S_OFFSET N_DIAGONAL_OFFSET S_DIAGONAL_OFFSET
	[if]
		direction=n
			
		[missile_frame]
			begin=-400
			end=100
			halo=projectiles/fire-breath-n-1.png:80,projectiles/fire-breath-n-2.png:80,projectiles/fire-breath-n-3.png:80,projectiles/fire-breath-n-4.png:80,projectiles/fire-breath-n-5.png:80
			halo_x,halo_y={N_OFFSET}
		[/missile_frame]
	[/if]
	[else]
		direction=s
				
		[missile_frame]
			begin=-400
			end=100
			halo=projectiles/fire-breath-s-1.png:80,projectiles/fire-breath-s-2.png:80,projectiles/fire-breath-s-3.png:80,projectiles/fire-breath-s-4.png:80,projectiles/fire-breath-s-5.png:80
			halo_x,halo_y={S_OFFSET}
		[/missile_frame]
	[/else]
	[else]
		direction=ne,nw
		
		[missile_frame]
			begin=-400
			end=100
			halo=projectiles/fire-breath-ne-1.png:80,projectiles/fire-breath-ne-2.png:80,projectiles/fire-breath-ne-3.png:80,projectiles/fire-breath-ne-4.png:80,projectiles/fire-breath-ne-5.png:80
			halo_x,halo_y={N_DIAGONAL_OFFSET}
		[/missile_frame]
	[/else]
	[else]
		direction=se,sw
				
		[missile_frame]
			begin=-400
			end=100
			halo=projectiles/fire-breath-se-1.png:80,projectiles/fire-breath-se-2.png:80,projectiles/fire-breath-se-3.png:80,projectiles/fire-breath-se-4.png:80,projectiles/fire-breath-se-5.png:80
			halo_x,halo_y={S_DIAGONAL_OFFSET}
		[/missile_frame]
	[/else]
#enddef

#define MISSILE_FRAME_FAERIE_FIRE
	[missile_frame]
		begin=-500
		end=-350
		image="projectiles/icemissile-n-1.png"
		image_diagonal="projectiles/icemissile-ne-1.png"
		halo=halo/elven/ice-halo1.png:100,halo/elven/ice-halo2.png:100,halo/elven/ice-halo3.png:25
		halo_x,halo_y=0,0
	[/missile_frame]
	[missile_frame]
		begin=-350
		end=-200
		image="projectiles/icemissile-n-2.png"
		image_diagonal="projectiles/icemissile-ne-2.png"
		halo=halo/elven/ice-halo3.png:75,halo/elven/ice-halo4.png:75
		halo_x,halo_y=0,0
	[/missile_frame]
	[missile_frame]
		begin=-200
		end=-50
		image="projectiles/icemissile-n-3.png"
		image_diagonal="projectiles/icemissile-ne-3.png"
		halo=halo/elven/ice-halo5.png:100,halo/elven/ice-halo1.png:100,halo/elven/ice-halo2.png:50
		halo_x,halo_y=0,0
	[/missile_frame]
	[missile_frame]
		begin=-50
		end=0
		image="projectiles/icemissile-n-4.png"
		image_diagonal="projectiles/icemissile-ne-4.png"
		halo=halo/elven/ice-halo6.png
		halo_x,halo_y=0,0
	[/missile_frame]
	[missile_frame]
		begin=25
		end=75
		image="projectiles/icemissile-n-5.png"
		image_diagonal="projectiles/icemissile-ne-5.png"
		halo=halo/elven/ice-halo7.png
		halo_x,halo_y=0,0
	[/missile_frame]
	[missile_frame]
		begin=75
		end=125
		image="projectiles/icemissile-n-6.png"
		image_diagonal="projectiles/icemissile-ne-6.png"
		halo=halo/elven/ice-halo8.png
		halo_x,halo_y=0,0
	[/missile_frame]
	[missile_frame]
		begin=125
		end=175
		image="projectiles/icemissile-n-7.png"
		image_diagonal="projectiles/icemissile-ne-7.png"
		halo=halo/elven/ice-halo9.png
		halo_x,halo_y=0,0
	[/missile_frame]
#enddef

#define MISSILE_FRAME_FIREBALL
	[missile_frame]
		begin=-220
		end=-100
		image="projectiles/fireball-n-2.png"
		image_diagonal="projectiles/fireball-nw-2.png"
	[/missile_frame]
	[missile_frame]
		begin=-100
		end=25
		image="projectiles/fireball-n.png"
		image_diagonal="projectiles/fireball-nw.png"
	[/missile_frame]
	[missile_frame]
		begin=25
		end=80
		image="projectiles/fireball-n-2.png"
		image_diagonal="projectiles/fireball-nw-2.png"
	[/missile_frame]
#enddef
