[unit]
#textdomain wesnoth-utbs
	id=Desert Ranger
	name= _ "Desert Ranger"
	race=elf
	image=newelves/desert-elvish-ranger.png
	hitpoints=42
	movement_type=woodland
# Desert elves move fast across the sands, but are not used to forests
# They are also a bit faster in caves
# Avengers move faster in mountains and shallow water
	[movement_costs]
		sand=1
		forest=2
		cave=2
		tundra=3
		shallow_water=2
		mountains=2
	[/movement_costs]
# Ranger defend better in shallow water and swamp
	[defense]
		sand=40
		forest=50
		shallow_water=70
		swamp_water=60
	[/defense]
	movement=6
	experience=80
	level=2
	alignment=lawful
	advanceto=Desert Avenger
	cost=40
#instead of ambush desert rangers have backstab
	usage=mixed fighter
	unit_description= _ "Desert Rangers are quick and powerful. Skilled in both short and long-range combat, Rangers are truly all-round fighters. Like their kin, they prefer the sword to the bow and are adept at sneaking around and backstabbing their enemies.

Special Notes: While a unit with the same allegiance as the Desert Ranger distracts an enemy, the Ranger may backstab, inflicting double damage, by creeping around behind that enemy."
	die_sound={SOUND_LIST:ELF_HIT}
	{DEFENSE_ANIM_FILTERED "newelves/desert-elvish-ranger-defend.png" newelves/desert-elvish-ranger.png {SOUND_LIST:ELF_HIT} range=melee}
	{DEFENSE_ANIM_FILTERED "newelves/desert-elvish-ranger-bow-defend.png" newelves/desert-elvish-ranger.png {SOUND_LIST:ELF_HIT} range=ranged}
	[death]
		[frame]
			begin=0
			end=100
			image="newelves/desert-elvish-ranger-die1.png"
		[/frame]
		[frame]
			begin=100
			end=200
			image="newelves/desert-elvish-ranger-die2.png"
		[/frame]
		[frame]
			begin=200
			end=300
			image="newelves/desert-elvish-ranger-die3.png"
		[/frame]
		[frame]
			begin=300
			end=400
			image="newelves/desert-elvish-ranger-die4.png"
		[/frame]
	[/death]
# melee attack stayed the same from 7-3 to 7-3
# ranged attack decreased from 7-4 to 6-4
# I decided not to increase melee damage I didn't want the
# backstab attack ability to be too powerful
# For comparison the level 2 Rogue unit has a 6,3 backstab attack
	[attack]
		name=sword
		description= _"sword"
		type=blade
		range=melee
		damage=7
		number=3
		[specials]
			{WEAPON_SPECIAL_BACKSTAB}
		[/specials]
		icon=attacks/sword-elven.png
		[animation]
		hits=no
			[frame]
				begin=-101
				end=100
				image=newelves/desert-elvish-ranger-attack.png
				sound={SOUND_LIST:MISS}
			[/frame]
		[/animation]
		[animation]
		hits=yes
			[frame]
				begin=-101
				end=100
				image=newelves/desert-elvish-ranger-attack.png
				sound={SOUND_LIST:SWORD_SWISH}
			[/frame]
		[/animation]
	[/attack]
	[attack]
		name=bow
		description= _"bow"
		type=pierce
		range=ranged
		damage=6
		number=4
		icon=attacks/bow-elven.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=-525
				end=-450
				image=newelves/desert-elvish-ranger-bow.png
			[/frame]
			[frame]
				begin=-450
				end=-300
				image=newelves/desert-elvish-ranger-attack1.png
				sound=bow-miss.ogg
			[/frame]
			[frame]
				begin=-300
				end=-200
				image=newelves/desert-elvish-ranger-attack2.png
			[/frame]
			[frame]
				begin=-200
				end=-100
				image=newelves/desert-elvish-ranger-attack3.png
			[/frame]
			[frame]
				begin=-100
				end=0
				image=newelves/desert-elvish-ranger-attack3.png
			[/frame]
			[frame]
				begin=0
				end=100
				image=newelves/desert-elvish-ranger-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=-525
				end=-450
				image=newelves/desert-elvish-ranger-bow.png
			[/frame]
			[frame]
				begin=-450
				end=-300
				image=newelves/desert-elvish-ranger-attack1.png
				sound=bow.ogg
			[/frame]
			[frame]
				begin=-300
				end=-200
				image=newelves/desert-elvish-ranger-attack2.png
			[/frame]
			[frame]
				begin=-200
				end=-100
				image=newelves/desert-elvish-ranger-attack3.png
			[/frame]
			[frame]
				begin=-100
				end=0
				image=newelves/desert-elvish-ranger-attack3.png
			[/frame]
			[frame]
				begin=0
				end=100
				image=newelves/desert-elvish-ranger-bow.png
			[/frame]
		[/animation]
	[/attack]
	[female]
		name= _ "female^Desert Ranger"
		id=Desert Ranger
		race=elf
		gender=female
		image="newelves/desert-elvish-ranger+female.png"
		hitpoints=42
		movement_type=woodland
#desert elves move fast across the sands, but are not used to forests
		[movement_costs]
			sand=1
			forest=2
			cave=2
			tundra=3
		[/movement_costs]
		[defense]
			sand=40
			forest=50
		[/defense]
		movement=6
		experience=80
		level=2
		alignment=lawful
		advanceto=Desert Avenger
		cost=40
		usage=mixed fighter
#instead of ambush desert rangers have backstab
		unit_description="Desert Rangers are quick and powerful. Skilled in both short and long-range combat, Rangers are truly all-round fighters. Like their kin, they prefer the sword to the bow and are adept at sneaking around and backstabbing their enemies."
		die_sound={SOUND_LIST:ELF_FEMALE_HIT}
		{DEFENSE_ANIM_FILTERED "newelves/desert-elvish-ranger+female-defend.png" "newelves/desert-elvish-ranger+female.png" {SOUND_LIST:ELF_FEMALE_HIT} range=melee}
		{DEFENSE_ANIM_FILTERED "newelves/desert-elvish-ranger+female-bow-defend.png" "newelves/desert-elvish-ranger+female.png" {SOUND_LIST:ELF_FEMALE_HIT} range=ranged}
		[death]
			[frame]
				begin=0
				end=100
				image="newelves/desert-elvish-ranger-die1.png"
			[/frame]
			[frame]
				begin=100
				end=200
				image="newelves/desert-elvish-ranger-die2.png"
			[/frame]
			[frame]
				begin=200
				end=300
				image="newelves/desert-elvish-ranger-die3.png"
			[/frame]
			[frame]
				begin=300
				end=400
				image="newelves/desert-elvish-ranger-die4.png"
			[/frame]
		[/death]
# originally 7,3 melee 7,4 ranged
# I decreased ranged damage by 1, decided not to increase melee
# damage because of backstab, don't want it to be too powerful
# For comparison the level 2 Rogue unit has a 6,3 backstab attack
		[attack]
			name=sword
			description= _"sword"
			type=blade
			range=melee
			damage=7
			number=3
			[specials]
				{WEAPON_SPECIAL_BACKSTAB}
			[/specials]
			icon=attacks/sword-elven.png
			[animation]
			hits=no
				[frame]
					begin=-101
					end=100
					image="newelves/desert-elvish-ranger+female-attack.png"
					sound={SOUND_LIST:MISS}
				[/frame]
			[/animation]
			[animation]
			hits=yes
				[frame]
					begin=-101
					end=100
					image="newelves/desert-elvish-ranger+female-attack.png"
					sound={SOUND_LIST:SWORD_SWISH}
				[/frame]
			[/animation]
		[/attack]
		[attack]
			name=bow
			description= _"bow"
			type=pierce
			range=ranged
			damage=6
			number=4
			icon=attacks/bow-elven.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=-525
					end=-450
					image="newelves/desert-elvish-ranger+female-bow.png"
				[/frame]
				[frame]
					begin=-450
					end=-300
					image="newelves/desert-elvish-ranger+female-attack1.png"
					sound=bow-miss.ogg
				[/frame]
				[frame]
					begin=-300
					end=-200
					image="newelves/desert-elvish-ranger+female-attack2.png"
				[/frame]
				[frame]
					begin=-200
					end=-100
					image="newelves/desert-elvish-ranger+female-attack3.png"
				[/frame]
				[frame]
					begin=-100
					end=0
					image="newelves/desert-elvish-ranger+female-attack3.png"
				[/frame]
				[frame]
					begin=0
					end=100
					image="newelves/desert-elvish-ranger+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=-525
					end=-450
					image="newelves/desert-elvish-ranger+female-bow.png"
				[/frame]
				[frame]
					begin=-450
					end=-300
					image="newelves/desert-elvish-ranger+female-attack1.png"
					sound=bow.ogg
				[/frame]
				[frame]
					begin=-300
					end=-200
					image="newelves/desert-elvish-ranger+female-attack2.png"
				[/frame]
				[frame]
					begin=-200
					end=-100
					image="newelves/desert-elvish-ranger+female-attack3.png"
				[/frame]
				[frame]
					begin=-100
					end=0
					image="newelves/desert-elvish-ranger+female-attack3.png"
				[/frame]
				[frame]
					begin=0
					end=100
					image="newelves/desert-elvish-ranger+female-bow.png"
				[/frame]
			[/animation]
		[/attack]
	[/female]
[/unit]
