[unit]
#textdomain wesnoth-utbs
	id=Desert Sharpshooter
	name= _ "Desert Sharpshooter"
	race=elf
	image=units/elves-desert/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_RANGE "units/elves-desert/sharpshooter-defend.png" units/elves-desert/sharpshooter.png {SOUND_LIST:ELF_HIT} melee}
	{DEFENSE_ANIM_RANGE "units/elves-desert/sharpshooter-bow-defend.png" units/elves-desert/sharpshooter.png {SOUND_LIST:ELF_HIT} ranged}
	[death]
		[frame]
			begin=0
			end=100
			image="units/elves-desert/sharpshooter-die1.png"
		[/frame]
		[frame]
			begin=100
			end=200
			image="units/elves-desert/sharpshooter-die2.png"
		[/frame]
		[frame]
			begin=200
			end=300
			image="units/elves-desert/sharpshooter-die3.png"
		[/frame]
		[frame]
			begin=300
			end=400
			image="units/elves-desert/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]
		[if]
			hits=yes
				[frame]
					begin=-101
					end=100
					image=units/elves-desert/sharpshooter-attack.png
					sound={SOUND_LIST:SWORD_SWISH}
				[/frame]
		[/if]
		[else]
			hits=no
				[frame]
					begin=-101
					end=100
					image=units/elves-desert/sharpshooter-attack.png
					sound={SOUND_LIST:MISS}
				[/frame]
		[/else]
		[/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]
			[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=units/elves-desert/sharpshooter-bow.png
			[/frame]
			[if]
				hits=yes
				[frame]
					begin=-380
					end=-305
					image=units/elves-desert/sharpshooter-attack1.png
					sound=bow.ogg
				[/frame]
			[/if]
			[else]
				hits=no
				[frame]
					begin=-380
					end=-305
					image=units/elves-desert/sharpshooter-attack1.png
					sound=bow-miss.ogg
				[/frame]
			[/else]
			[frame]
				begin=-305
				end=-230
				image=units/elves-desert/sharpshooter-attack2.png
			[/frame]
			[frame]
				begin=-230
				end=-130
				image=units/elves-desert/sharpshooter-attack3.png
			[/frame]
			[frame]
				begin=-130
				end=-100
				image=units/elves-desert/sharpshooter-attack4.png
			[/frame]
			[frame]
				begin=-100
				end=0
				image=units/elves-desert/sharpshooter-attack4.png
			[/frame]
			[frame]
				begin=0
				end=65
				image=units/elves-desert/sharpshooter-bow.png
			[/frame]
		[/animation]
	[/attack]
	[female]
		id=Desert Sharpshooter
		name= _ "female^Desert Sharpshooter"
		race=elf
		gender=female
		image="units/elves-desert/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_RANGE "units/elves-desert/sharpshooter+female-defend.png" "units/elves-desert/sharpshooter+female.png" {SOUND_LIST:ELF_FEMALE_HIT} melee}
		{DEFENSE_ANIM_RANGE "units/elves-desert/sharpshooter+female-bow-defend.png" "units/elves-desert/sharpshooter+female.png" {SOUND_LIST:ELF_FEMALE_HIT} ranged}
		[death]
			[frame]
				begin=0
				end=100
				image="units/elves-desert/sharpshooter-die1.png"
			[/frame]
			[frame]
				begin=100
				end=200
				image="units/elves-desert/sharpshooter-die2.png"
			[/frame]
			[frame]
				begin=200
				end=300
				image="units/elves-desert/sharpshooter-die3.png"
			[/frame]
			[frame]
				begin=300
				end=400
				image="units/elves-desert/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]
			[if]
				hits=yes
					[frame]
						begin=-101
						end=100
						image="units/elves-desert/sharpshooter+female-attack.png"
						sound={SOUND_LIST:SWORD_SWISH}
					[/frame]
			[/if]
			[else]
				hits=no
					[frame]
						begin=-101
						end=100
						image="units/elves-desert/sharpshooter+female-attack.png"
						sound={SOUND_LIST:MISS}
					[/frame]
			[/else]
			[/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]
				[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="units/elves-desert/sharpshooter+female-bow.png"
				[/frame]
				[if]
					hits=yes
					[frame]
						begin=-380
						end=-305
						image="units/elves-desert/sharpshooter+female-attack1.png"
						sound=bow.ogg
					[/frame]
				[/if]
				[else]
					hits=no
					[frame]
						begin=-380
						end=-305
						image="units/elves-desert/sharpshooter+female-attack1.png"
						sound=bow-miss.ogg
					[/frame]
				[/else]
				[frame]
					begin=-305
					end=-230
					image="units/elves-desert/sharpshooter+female-attack2.png"
				[/frame]
				[frame]
					begin=-230
					end=-130
					image="units/elves-desert/sharpshooter+female-attack3.png"
				[/frame]
				[frame]
					begin=-130
					end=-100
					image="units/elves-desert/sharpshooter+female-attack4.png"
				[/frame]
				[frame]
					begin=-100
					end=0
					image="units/elves-desert/sharpshooter+female-attack4.png"
				[/frame]
				[frame]
					begin=0
					end=65
					image="units/elves-desert/sharpshooter+female-bow.png"
				[/frame]
			[/animation]
		[/attack]
	[/female]
[/unit]
