[unit]
#textdomain wesnoth-utbs
	id=Desert Sharpshooter
	name= _ "Desert Sharpshooter"
	race=elf
	image=newelves/desert-elvish-sharpshooter.png
	hitpoints=47
	movement_type=woodland
#desert elves move fast across the sands, but are not used to forests
#they are also a bit faster in caves
	[movement_costs]
		sand=1
		forest=2
		cave=2
		tundra=3
	[/movement_costs]
	[defense]
		sand=40
		forest=50
	[/defense]
	movement=6
	experience=100
	level=3
	alignment=lawful
	advanceto=null
	{AMLA_TOUGH 3}
	cost=90
	usage=archer
	unit_description= _ "The most elite archers among the elves, Desert Sharpshooters use the best bows and arrows available, which makes them just as deadly as their ancestors. Desert Sharpshooters are incredibly accurate, even when firing very quickly, which makes them excellent at picking off entrenched enemies.

Special Notes: Their marksmanship gives these elves a high chance of hitting their enemy, but only on the attack."
	die_sound={SOUND_LIST:ELF_HIT}
	{DEFENSE_ANIM_FILTERED "newelves/desert-elvish-sharpshooter-defend.png" newelves/desert-elvish-sharpshooter.png {SOUND_LIST:ELF_HIT} range=melee}
	{DEFENSE_ANIM_FILTERED "newelves/desert-elvish-sharpshooter-bow-defend.png" newelves/desert-elvish-sharpshooter.png {SOUND_LIST:ELF_HIT} range=ranged}
	[death]
		[frame]
			begin=0
			end=100
			image="newelves/desert-elvish-sharpshooter-die1.png"
		[/frame]
		[frame]
			begin=100
			end=200
			image="newelves/desert-elvish-sharpshooter-die2.png"
		[/frame]
		[frame]
			begin=200
			end=300
			image="newelves/desert-elvish-sharpshooter-die3.png"
		[/frame]
		[frame]
			begin=300
			end=400
			image="newelves/desert-elvish-sharpshooter-die4.png"
		[/frame]
	[/death]
# Because of the elvish sharpshooter's skill, I make an exception
# to the desert elf rule of decreasing the ranged attack and
# increasing the melee attack. In this case I just increase the
# melee attack and don't decrease the ranged.
# This is a reward for the player getting a level 3 sharpshooter
# and because since the sharpshooter has 5 attacks, reducing
# the ranged damage by 1 is a big penalty. Overall the desert elves
# are bad at ranged attacks, but I want to give the player one
# exception
	[attack]
		name=sword
		description= _"sword"
		type=blade
		range=melee
		damage=8
		number=2
		icon=attacks/sword-elven.png
		[animation]
		hits=no
			[frame]
				begin=-101
				end=100
				image=newelves/desert-elvish-sharpshooter-attack.png
				sound={SOUND_LIST:MISS}
			[/frame]
		[/animation]
		[animation]
		hits=yes
			[frame]
				begin=-101
				end=100
				image=newelves/desert-elvish-sharpshooter-attack.png
				sound={SOUND_LIST:SWORD_SWISH}
			[/frame]
		[/animation]
	[/attack]
	[attack]
		name=longbow
		description= _"longbow"
		type=pierce
		range=ranged
		damage=10
		number=5
		[specials]
			{WEAPON_SPECIAL_MARKSMAN}
		[/specials]
		icon=attacks/bow-elven-magic.png
		[animation]
			hits=no
			[missile_frame]
				begin=-100
				end=0
				image=projectiles/missile-n.png
				image_diagonal=projectiles/missile-ne.png
			[/missile_frame]
			[frame]
				begin=-445
				end=-380
				image=newelves/desert-elvish-sharpshooter-bow.png
			[/frame]
			[frame]
				begin=-380
				end=-305
				image=newelves/desert-elvish-sharpshooter-attack1.png
				sound=bow-miss.ogg
			[/frame]
			[frame]
				begin=-305
				end=-230
				image=newelves/desert-elvish-sharpshooter-attack2.png
			[/frame]
			[frame]
				begin=-230
				end=-130
				image=newelves/desert-elvish-sharpshooter-attack3.png
			[/frame]
			[frame]
				begin=-130
				end=-100
				image=newelves/desert-elvish-sharpshooter-attack4.png
			[/frame]
			[frame]
				begin=-100
				end=0
				image=newelves/desert-elvish-sharpshooter-attack4.png
			[/frame]
			[frame]
				begin=0
				end=65
				image=newelves/desert-elvish-sharpshooter-bow.png
			[/frame]
		[/animation]
		[animation]
			hits=yes
			[missile_frame]
				begin=-100
				end=0
				image=projectiles/missile-n.png
				image_diagonal=projectiles/missile-ne.png
			[/missile_frame]
			[frame]
				begin=-445
				end=-380
				image=newelves/desert-elvish-sharpshooter-bow.png
			[/frame]
			[frame]
				begin=-380
				end=-305
				image=newelves/desert-elvish-sharpshooter-attack1.png
				sound=bow.ogg
			[/frame]
			[frame]
				begin=-305
				end=-230
				image=newelves/desert-elvish-sharpshooter-attack2.png
			[/frame]
			[frame]
				begin=-230
				end=-130
				image=newelves/desert-elvish-sharpshooter-attack3.png
			[/frame]
			[frame]
				begin=-130
				end=-100
				image=newelves/desert-elvish-sharpshooter-attack4.png
			[/frame]
			[frame]
				begin=-100
				end=0
				image=newelves/desert-elvish-sharpshooter-attack4.png
			[/frame]
			[frame]
				begin=0
				end=65
				image=newelves/desert-elvish-sharpshooter-bow.png
			[/frame]
		[/animation]
	[/attack]
	[female]
		id=Desert Sharpshooter
		name= _ "female^Desert Sharpshooter"
		race=elf
		gender=female
		image="newelves/desert-elvish-sharpshooter+female.png"
		hitpoints=45
		movement_type=woodland
# Desert elves move fast across the sands, but are not used to
# forests. they are also a bit faster in caves
		[movement_costs]
			sand=1
			forest=2
			cave=2
			tundra=3
		[/movement_costs]
		[defense]
			sand=40
			forest=50
		[/defense]
		movement=6
		experience=100
		level=3
		alignment=lawful
		advanceto=null
		{AMLA_TOUGH 3}
		cost=90
		usage=archer
		unit_description="The most elite archers among the elves, Desert Sharpshooters use the best bows and arrows available, which makes them just as deadly as their ancestors. Desert Sharpshooters are incredibly accurate, even when firing very quickly, which makes them excellent at picking off entrenched enemies.

Special Notes: Their marksmanship gives these elves a high chance of hitting their enemy, but only on the attack."
		die_sound={SOUND_LIST:ELF_FEMALE_HIT}
		{DEFENSE_ANIM_FILTERED "newelves/desert-elvish-sharpshooter+female-defend.png" "newelves/desert-elvish-sharpshooter+female.png" {SOUND_LIST:ELF_FEMALE_HIT} range=melee}
		{DEFENSE_ANIM_FILTERED "newelves/desert-elvish-sharpshooter+female-bow-defend.png" "newelves/desert-elvish-sharpshooter+female.png" {SOUND_LIST:ELF_FEMALE_HIT} range=ranged}
		[death]
			[frame]
				begin=0
				end=100
				image="newelves/desert-elvish-sharpshooter-die1.png"
			[/frame]
			[frame]
				begin=100
				end=200
				image="newelves/desert-elvish-sharpshooter-die2.png"
			[/frame]
			[frame]
				begin=200
				end=300
				image="newelves/desert-elvish-sharpshooter-die3.png"
			[/frame]
			[frame]
				begin=300
				end=400
				image="newelves/desert-elvish-sharpshooter-die4.png"
			[/frame]
		[/death]
# Because of the elvish sharpshooter's skill, I make an exception
# to the desert elf rule of decreasing the ranged attack and
# increasing the melee attack. In this case I just increase the
# melee attack and don't decrease the ranged.
# This is a reward for the player getting a level 3 sharpshooter
# and because since the sharpshooter has 5 attacks, reducing
# the ranged damage by 1 is a big penalty. Overall the desert elves
# are bad at ranged attacks, but I want to give the player one
# exception
		[attack]
			name=sword
			description= _"sword"
			type=blade
			range=melee
			damage=8
			number=2
			icon=attacks/sword-elven.png
			[animation]
			hits=no
				[frame]
					begin=-101
					end=100
					image="newelves/desert-elvish-sharpshooter+female-attack.png"
					sound={SOUND_LIST:MISS}
				[/frame]
			[/animation]
			[animation]
			hits=yes
				[frame]
					begin=-101
					end=100
					image="newelves/desert-elvish-sharpshooter+female-attack.png"
					sound={SOUND_LIST:SWORD_SWISH}
				[/frame]
			[/animation]
		[/attack]
		[attack]
			name=longbow
			description= _"longbow"
			type=pierce
			[specials]
				{WEAPON_SPECIAL_MARKSMAN}
			[/specials]
			range=ranged
			damage=10
			number=5
			icon=attacks/bow-elven-magic.png
			[animation]
				hits=no
				[missile_frame]
					begin=-100
					end=0
					image=projectiles/missile-n.png
					image_diagonal=projectiles/missile-ne.png
				[/missile_frame]
				[frame]
					begin=-445
					end=-380
					image="newelves/desert-elvish-sharpshooter+female-bow.png"
				[/frame]
				[frame]
					begin=-380
					end=-305
					image="newelves/desert-elvish-sharpshooter+female-attack1.png"
					sound=bow-miss.ogg
				[/frame]
				[frame]
					begin=-305
					end=-230
					image="newelves/desert-elvish-sharpshooter+female-attack2.png"
				[/frame]
				[frame]
					begin=-230
					end=-130
					image="newelves/desert-elvish-sharpshooter+female-attack3.png"
				[/frame]
				[frame]
					begin=-130
					end=-100
					image="newelves/desert-elvish-sharpshooter+female-attack4.png"
				[/frame]
				[frame]
					begin=-100
					end=0
					image="newelves/desert-elvish-sharpshooter+female-attack4.png"
				[/frame]
				[frame]
					begin=0
					end=65
					image="newelves/desert-elvish-sharpshooter+female-bow.png"
				[/frame]
			[/animation]
			[animation]
				hits=yes
				[missile_frame]
					begin=-100
					end=0
					image=projectiles/missile-n.png
					image_diagonal=projectiles/missile-ne.png
				[/missile_frame]
				[frame]
					begin=-445
					end=-380
					image="newelves/desert-elvish-sharpshooter+female-bow.png"
				[/frame]
				[frame]
					begin=-380
					end=-305
					image="newelves/desert-elvish-sharpshooter+female-attack1.png"
					sound=bow.ogg
				[/frame]
				[frame]
					begin=-305
					end=-230
					image="newelves/desert-elvish-sharpshooter+female-attack2.png"
				[/frame]
				[frame]
					begin=-230
					end=-130
					image="newelves/desert-elvish-sharpshooter+female-attack3.png"
				[/frame]
				[frame]
					begin=-130
					end=-100
					image="newelves/desert-elvish-sharpshooter+female-attack4.png"
				[/frame]
				[frame]
					begin=-100
					end=0
					image="newelves/desert-elvish-sharpshooter+female-attack4.png"
				[/frame]
				[frame]
					begin=0
					end=65
					image="newelves/desert-elvish-sharpshooter+female-bow.png"
				[/frame]
			[/animation]
		[/attack]
	[/female]
[/unit]
