Difference between revisions of "Campaign/Forgotten Legacy/Unit Utils"

From The Battle for Wesnoth Wiki
(Categorize)
m (recategorizing)
 
Line 277: Line 277:
 
</pre>
 
</pre>
  
[[Category:Campaigns]]
+
[[Category:Forgotten Legacy]]

Latest revision as of 12:50, 23 March 2008

# I'm putting The Forgotten Legacy's common unit macros in here.
# I've shamlessly copied Southguard's macro file which in turn
# had pillaged from The Rise of Wesnoth and the Useful WML Fragemnts Wiki

#define OFFENSIVE_SAURIAN
		[defense]
			shallow_water=70 
			forest=50 
			hills=60 
			mountains=60 
			castle=50 
			cave=50 
		[/defense]
#enddef

#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_special=slow
			increase_attacks=1
		[/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=mace.png

			range=short
			type=impact

			damage=7
			number=2
		[/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 FL_STRONG
	[trait]
		id=strong
		name= _ "strong"
		[effect]
			apply_to=attack
			range=short
			increase_damage=2
		[/effect]
		[effect]
			apply_to=hitpoints
			increase_total=2
			heal_full=yes
		[/effect]
	[/trait]
#enddef

#define FL_DEXTROUS
	[trait]
		id=strong
		name= _ "dextrous"
		[effect]
			apply_to=attack
			range=long
			increase_damage=1
		[/effect]
	[/trait]
#enddef

#define FL_RESILIENT
	[trait]
		id=resilient
		name= _ "resilient"
		[effect]
			apply_to=hitpoints
			increase_total=7
			#make sure the unit starts at full health
			heal_full=yes
		[/effect]
	[/trait]
#enddef

#define FL_ELITE
	[trait]
		id=elite
		name= _ "Elite Guard"
		[effect]
			apply_to=hitpoints
			increase_total=+20%
		[/effect]
		[effect]
			apply_to=hitpoints
			increase_total=20
			#make sure the unit starts at full health
			heal_full=yes
		[/effect]
		[effect]
			apply_to=loyal
		[/effect]
		[effect]
			apply_to=attack
			range=short
			increase_damage=6
		[/effect]
	[/trait]
#enddef


#define FL_QUICK
	[trait]
		id=quick
		name= _ "quick"
		[effect]
			apply_to=movement
			increase=1
		[/effect]
		[effect]
			apply_to=hitpoints
			increase_total=-10%
			heal_full=yes
		[/effect]
	[/trait]
#enddef

#define FL_AGILE
	[trait]
		id=dextrous
		name= _ "dextrous"
		[effect]
			apply_to=attack
			range=long
			increase_damage=-10%
		[/effect]
		[effect]
			apply_to=attack
			range=long
			increase_attacks=1
		[/effect]
	[/trait]
#enddef

#define FL_INTELLIGENT
	[trait]
		id=intelligent
		name= _ "intelligent"
		[effect]
			apply_to=max_experience
			increase=-20%
		[/effect]
	[/trait]
#enddef

#define FL_LOYAL
	[trait]
		id=loyal
		name= _ "loyal"
		[effect]
			apply_to=loyal
		[/effect]
	[/trait]
#enddef

#define FL_UNIT TYPE DESCRIPTION SIDE X Y
		[unit]
			type={TYPE}
			side={SIDE}
			description={DESCRIPTION}
			x,y={X},{Y}
			traits_description= _ "loyal"
			random_traits=yes
			[modifications]
				{FL_LOYAL}
			[/modifications]

		[/unit]
#enddef

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

#define FL_FOREST_GUARD TYPE DESCRIPTION SIDE X Y
		[unit]
			type={TYPE}
			side={SIDE}
			description={DESCRIPTION}
			x,y={X},{Y}
			ai_special=guardian
			random_traits=yes
			[status]
				ambush=on
			[/status]
		[/unit]
#enddef

#define FL_GUARD TYPE DESCRIPTION SIDE X Y
		[unit]
			type={TYPE}
			description={DESCRIPTION}
			side={SIDE}
			x,y={X},{Y}
			ai_special=guardian
			random_traits=yes
		[/unit]
#enddef

#define PUFF_OF_SMOKE X Y
    {VARIABLE smoke_image_num 1}

    {REPEAT}
        {VARIABLE_OP smoke_image_filename format puff_of_smoke/smoke_$smoke_image_num|.png}

        [item]
            x,y={X},{Y}
            halo=$smoke_image_filename
        [/item]

        [redraw][/redraw]

        [delay]
            time=25
        [/delay]

        [removeitem]
            x,y={X},{Y}
        [/removeitem]

        {VARIABLE_OP smoke_image_num add 1}
    {TIMES 12}

    {redraw}
#enddef
This page was last edited on 23 March 2008, at 12:50.