# I'm putting The South Guard's common unit macros in here.
# This should make my WML a little more sane.  Most of these
# I've shamlessly pillaged from The Rise of Wesnoth and the Useful WML Fragemnts Wiki

#textdomain wesnoth-tsg


#define AMLA_BARBED_LANCE ATTACK
	[advancement]
		max_times=1
		id=sg_barbs
		description= _ "Place barbs on your weapon. (slow)"
		[effect]
			apply_to=attack
			name={ATTACK}
			[set_specials]
				{WEAPON_SPECIAL_CHARGE}
				{WEAPON_SPECIAL_SLOW}
			[/set_specials]
		[/effect]
		[effect]
			apply_to=max_experience
			increase=12
		[/effect]
	[/advancement]
#enddef

#define AMLA_MACE
	[advancement]
		max_times=1
		id=sg_mace
		description= _ "Wield a mace. (impact)"
		[effect]
			apply_to=new_attack
			name=mace
			icon=attacks/mace.png

			range=melee
			type=impact

			damage=7
			number=2

			[animation]
				hits=yes
				[frame]
					begin=-225
					end=-200
					image=deoran/horseman-commander.png
					sound=horse-canter.wav
				[/frame]
				[frame]
					begin=-200
					end=-100
					image=deoran/horseman-commander-moving.png
				[/frame]
				[frame]
					begin=-100
					end=100
					# we probably need an mace attack frame for Deoran
					image=deoran/horseman-commander-defend.png
					sound=mace.wav
				[/frame]
				[frame]
					begin=100
					end=175
					image=deoran/horseman-commander-moving.png
				[/frame]
				[frame]
					begin=175
					end=200
					image=deoran/horseman-commander.png
				[/frame]
			[/animation]
			[animation]
				hits=no
				[frame]
					begin=-225
					end=-200
					image=deoran/horseman-commander.png
					sound=horse-canter.wav
				[/frame]
				[frame]
					begin=-200
					end=-100
					image=deoran/horseman-commander-moving.png
				[/frame]
				[frame]
					begin=-100
					end=100
					# we probably need an mace attack frame for Deoran
					image=deoran/horseman-commander-defend.png
					sound={SOUND_LIST:MISS}
				[/frame]
				[frame]
					begin=100
					end=175
					image=deoran/horseman-commander-moving.png
				[/frame]
				[frame]
					begin=175
					end=200
					image=deoran/horseman-commander.png
				[/frame]
			[/animation]

		[/effect]
		[effect]
			apply_to=max_experience
			increase=12
		[/effect]

	[/advancement]
#enddef

#define AMLA_COURAGEOUS ATTACK
	[advancement]
		max_times=2
		id=sg_courageous
		description= _ "Add a swing to your attack."
		[effect]
			apply_to=attack
			name={ATTACK}
			increase_attacks=1
		[/effect]
		[effect]
			apply_to=max_experience
			increase=6
		[/effect]
	[/advancement]
#enddef

#define SG_STRONG
	[trait]
		id=strong
		male_name= _ "strong"
		female_name= _ "female^strong"
		[effect]
			apply_to=attack
			range=melee
			increase_damage=2
		[/effect]
		[effect]
			apply_to=hitpoints
			increase_total=2
			heal_full=yes
		[/effect]
	[/trait]
#enddef

#define SG_RESILIENT
	[trait]
		id=resilient
		male_name= _ "resilient"
		female_name= _ "female^resilient"
		[effect]
			apply_to=hitpoints
			increase_total=7
			#make sure the unit starts at full health
			heal_full=yes
		[/effect]
	[/trait]
#enddef

#define SG_QUICK
	[trait]
		id=quick
		male_name= _ "quick"
		female_name= _ "female^quick"
		[effect]
			apply_to=movement
			increase=1
		[/effect]
		[effect]
			apply_to=hitpoints
			increase_total=-10%
			heal_full=yes
		[/effect]
	[/trait]
#enddef

#define SG_INTELLIGENT
	[trait]
		id=intelligent
		male_name= _ "intelligent"
		female_name= _ "female^intelligent"
		[effect]
			apply_to=max_experience
			increase=-20%
		[/effect]
	[/trait]
#enddef

#define SG_LOYAL
	[trait]
		id=loyal
		male_name= _ "loyal"
		female_name= _ "female^loyal"
		[effect]
			apply_to=loyal
		[/effect]
	[/trait]
#enddef

#define SG_UNIT TYPE DESCRIPTION USER_DESCRIPTION SIDE X Y
		[unit]
			type={TYPE}
			side={SIDE}
			description={DESCRIPTION}
			user_description={USER_DESCRIPTION}
			x,y={X},{Y}
			traits_description= _ "loyal"
		[modifications]
			{SG_LOYAL}
		[/modifications]

		[/unit]
#enddef

#define SG_AMBUSHER TYPE DESCRIPTION USER_DESCRIPTION SIDE X Y
		[unit]
			type={TYPE}
			side={SIDE}
			description={DESCRIPTION}
			user_description={USER_DESCRIPTION}
			x,y={X},{Y}
			[status]
				ambush=on
			[/status]
		[/unit]
#enddef

#define SG_GUARD TYPE DESCRIPTION USER_DESCRIPTION SIDE X Y
		[unit]
			type={TYPE}
			description={DESCRIPTION}
			user_description={USER_DESCRIPTION}
			side={SIDE}
			x,y={X},{Y}
			ai_special=guardian
		[/unit]
#enddef
