#textdomain wesnoth
# Macros for setting animations.

# These don't rely on any other macros.   Please don't change this.

#define STANDING_ANIM_DIRECTIONAL BASE_SE_IMAGE BASE_NE_IMAGE
    [standing_anim]
        start_time=0
        [if]
            direction=s,se,sw
            [frame]
                duration=150
                image={BASE_SE_IMAGE}
            [/frame]
        [/if]
        [else]
            direction=n,ne,nw
            [frame]
                duration=150
                image={BASE_NE_IMAGE}
            [/frame]
        [/else]
    [/standing_anim]
#enddef

#define LEADING_ANIM FULL_IMAGE HALFWAYS_IMAGE OFFSET_POSITION
    # Define an animation of a unit waving/raising their weapon,
    # with a gleam of light reflecting off it at the point specified by
    # OFFSET_POSITION
    [leading_anim]
        start_time=-126
        [frame]
            duration=1
            image={HALFWAYS_IMAGE}
        [/frame]
        [frame]
            duration=100
            image={FULL_IMAGE}
        [/frame]
        [frame]
            duration=150
            image={FULL_IMAGE}
        [/frame]
        [frame]
            duration=1
            image={HALFWAYS_IMAGE}
        [/frame]

        [halo_frame]
            begin=-120
            end=-100
            halo=""     # Deliberate null image ref.
            # Intended to keep the next image from persisting onscreen.
            halo_x,halo_y={OFFSET_POSITION}
        [/halo_frame]
        [halo_frame]
            begin=-100
            end=-80
            halo="halo/misc/leadership-flare-1.png"
            halo_x,halo_y={OFFSET_POSITION}
        [/halo_frame]
        [halo_frame]
            begin=-80
            end=-60
            halo="halo/misc/leadership-flare-2.png"
            halo_x,halo_y={OFFSET_POSITION}
        [/halo_frame]
        [halo_frame]
            begin=-60
            end=-40
            halo="halo/misc/leadership-flare-3.png"
            halo_x,halo_y={OFFSET_POSITION}
        [/halo_frame]
        [halo_frame]
            begin=-40
            end=-20
            halo="halo/misc/leadership-flare-4.png"
            halo_x,halo_y={OFFSET_POSITION}
        [/halo_frame]
        [halo_frame]
            begin=-20
            end=0
            halo="halo/misc/leadership-flare-5.png"
            halo_x,halo_y={OFFSET_POSITION}
        [/halo_frame]
        [halo_frame]
            begin=0
            end=20
            halo="halo/misc/leadership-flare-6.png"
            halo_x,halo_y={OFFSET_POSITION}
        [/halo_frame]
        [halo_frame]
            begin=20
            end=40
            halo="halo/misc/leadership-flare-7.png"
            halo_x,halo_y={OFFSET_POSITION}
        [/halo_frame]
        [halo_frame]
            begin=40
            end=60
            halo="halo/misc/leadership-flare-8.png"
            halo_x,halo_y={OFFSET_POSITION}
        [/halo_frame]
        [halo_frame]
            begin=60
            end=80
            halo="halo/misc/leadership-flare-9.png"
            halo_x,halo_y={OFFSET_POSITION}
        [/halo_frame]
        [halo_frame]
            begin=80
            end=100
            halo="halo/misc/leadership-flare-10.png"
            halo_x,halo_y={OFFSET_POSITION}
        [/halo_frame]
        [halo_frame]
            begin=100
            end=120
            halo="halo/misc/leadership-flare-11.png"
            halo_x,halo_y={OFFSET_POSITION}
        [/halo_frame]
        [halo_frame]
            begin=120
            end=140
            halo="halo/misc/leadership-flare-12.png"
            halo_x,halo_y={OFFSET_POSITION}
        [/halo_frame]
        [halo_frame]
            begin=140
            end=160
            halo="halo/misc/leadership-flare-13.png"
            halo_x,halo_y={OFFSET_POSITION}
        [/halo_frame]
        [halo_frame]
            begin=160
            end=200
            halo=""     # Deliberate null image ref.
            # Intended to keep the previous image from persisting onscreen.
            halo_x,halo_y={OFFSET_POSITION}
        [/halo_frame]
    [/leading_anim]
#enddef

#define DEFENSE_ANIM REACTION_IMAGE BASE_IMAGE HIT_SOUND
    # Define a defensive animation moving from a specified BASE_IMAGE
    # to REACTION_IMAGE, with HIT_SOUND playing only if a hit occurs.
    [defend]
        start_time=-126
        [frame]
            duration=1
            image={BASE_IMAGE}
        [/frame]
        [frame]
            duration=100
            image={REACTION_IMAGE}
        [/frame]
        [if]
            hits=hit
            [frame]
                duration=150
                image={REACTION_IMAGE}
                sound={HIT_SOUND}
            [/frame]
        [/if]
        [else]
            hits=miss,kill
            [frame]
                duration=150
                image={REACTION_IMAGE}
            [/frame]
        [/else]
        [frame]
            duration=1
            image={BASE_IMAGE}
        [/frame]
    [/defend]
#enddef

#define DEFENSE_ANIM_FILTERED REACTION_IMAGE BASE_IMAGE HIT_SOUND FILTER
    # Define a defensive animation moving from a specified BASE_IMAGE
    # to REACTION_IMAGE, with HIT_SOUND playing only if a hit occurs.  This
    # fires only if FILTER is matched.
    [defend]
        start_time=-126
        {FILTER}
        [frame]
            duration=1
            image={BASE_IMAGE}
        [/frame]
        [frame]
            duration=100
            image={REACTION_IMAGE}
        [/frame]
        [if]
            hits=hit
            [frame]
                duration=150
                image={REACTION_IMAGE}
                sound={HIT_SOUND}
            [/frame]
        [/if]
        [else]
            hits=miss,kill
            [frame]
                duration=150
                image={REACTION_IMAGE}
            [/frame]
        [/else]
        [frame]
            duration=1
            image={BASE_IMAGE}
        [/frame]
    [/defend]
#enddef

#define DEFENSE_ANIM_RANGE REACTION_IMAGE BASE_IMAGE HIT_SOUND RANGE
    # Define a defensive animation moving from a specified BASE_IMAGE
    # to REACTION_IMAGE, with HIT_SOUND playing only if a hit occurs.  This
    # fires only on the class of attacks specified by RANGE.
    [defend]
        start_time=-126
        [filter_attack]
            range={RANGE}
        [/filter_attack]
        [frame]
            duration=1
            image={BASE_IMAGE}
        [/frame]
        [frame]
            duration=100
            image={REACTION_IMAGE}
        [/frame]
        [if]
            hits=hit
            [frame]
                duration=150
                image={REACTION_IMAGE}
                sound={HIT_SOUND}
            [/frame]
        [/if]
        [else]
            hits=miss,kill
            [frame]
                duration=150
                image={REACTION_IMAGE}
            [/frame]
        [/else]
        [frame]
            duration=1
            image={BASE_IMAGE}
        [/frame]
    [/defend]
#enddef

#define DEFENSE_ANIM_DIRECTIONAL REACTION_SE_IMAGE BASE_SE_IMAGE REACTION_NE_IMAGE BASE_NE_IMAGE HITSOUND
    [defend]
        direction=sw,s,se
        start_time=-126
        [frame]
            duration=1
            image={BASE_SE_IMAGE}
        [/frame]
        [frame]
            duration=100
            image={REACTION_SE_IMAGE}
        [/frame]
        [if]
            hits=hit
            [frame]
                duration=150
                image={REACTION_SE_IMAGE}
                sound={HITSOUND}
            [/frame]
        [/if]
        [else]
            hits=miss,kill
            [frame]
                duration=150
                image={REACTION_SE_IMAGE}
            [/frame]
        [/else]
        [frame]
            duration=1
            image={BASE_SE_IMAGE}
        [/frame]
    [/defend]
    [defend]
        direction=nw,n,ne
        start_time=-126
        [frame]
            duration=1
            image={BASE_NE_IMAGE}
        [/frame]
        [frame]
            duration=100
            image={REACTION_NE_IMAGE}
        [/frame]
        [if]
            hits=hit
            [frame]
                duration=150
                image={REACTION_NE_IMAGE}
                sound={HITSOUND}
            [/frame]
        [/if]
        [else]
            hits=miss,kill
            [frame]
                duration=150
                image={REACTION_NE_IMAGE}
            [/frame]
        [/else]
        [frame]
            duration=1
            image={BASE_NE_IMAGE}
        [/frame]
    [/defend]
#enddef

#define DEFENSE_ANIM_DIRECTIONAL_RANGE REACTION_SE_IMAGE BASE_SE_IMAGE REACTION_NE_IMAGE BASE_NE_IMAGE HITSOUND RANGE
    [defend]
        direction=sw,s,se
        [filter_attack]
            range={RANGE}
        [/filter_attack]
        start_time=-126
        [frame]
            duration=1
            image={BASE_SE_IMAGE}
        [/frame]
        [frame]
            duration=100
            image={REACTION_SE_IMAGE}
        [/frame]
        [if]
            hits=hit
            [frame]
                duration=150
                image={REACTION_SE_IMAGE}
                sound={HITSOUND}
            [/frame]
        [/if]
        [else]
            hits=miss,kill
            [frame]
                duration=150
                image={REACTION_SE_IMAGE}
            [/frame]
        [/else]
        [frame]
            duration=1
            image={BASE_SE_IMAGE}
        [/frame]
    [/defend]
    [defend]
        direction=nw,n,ne
        [filter_attack]
            range={RANGE}
        [/filter_attack]
        start_time=-126
        [frame]
            duration=1
            image={BASE_NE_IMAGE}
        [/frame]
        [frame]
            duration=100
            image={REACTION_NE_IMAGE}
        [/frame]
        [if]
            hits=hit
            [frame]
                duration=150
                image={REACTION_NE_IMAGE}
                sound={HITSOUND}
            [/frame]
        [/if]
        [else]
            hits=miss,kill
            [frame]
                duration=150
                image={REACTION_NE_IMAGE}
            [/frame]
        [/else]
        [frame]
            duration=1
            image={BASE_NE_IMAGE}
        [/frame]
    [/defend]
#enddef

#define DEFENSE_ANIM_ELVEN_RANGE REACTION_IMAGE BASE_IMAGE HIT_SOUND RANGE
    # Define a defensive animation moving from a specified BASE_IMAGE
    # to REACTION_IMAGE, with HIT_SOUND playing only if a hit occurs and an
    # elven halo waxing and waning during the animation.  This
    # fires only on the class of attacks specified by RANGE.
    [defend]
        start_time=-175
        [filter_attack]
            range={RANGE}
        [/filter_attack]
        [frame]
            duration=25
            image={BASE_IMAGE}
            halo=halo/elven/elven-shield-halo-20pct.png
        [/frame]
        [frame]
            duration=25
            image={BASE_IMAGE}
            halo=halo/elven/elven-shield-halo-40pct.png
        [/frame]
        [frame]
            duration=50
            image={REACTION_IMAGE}
            halo=halo/elven/elven-shield-halo-60pct.png
        [/frame]
        [frame]
            duration=50
            image={REACTION_IMAGE}
            halo=halo/elven/elven-shield-halo-80pct.png
        [/frame]
        [if]
            hits=hit
            [frame]
                duration=100
                image={REACTION_IMAGE}
                sound={HIT_SOUND}
                halo=halo/elven/elven-shield-halo-100pct.png
            [/frame]
        [/if]
        [else]
            hits=miss,kill
            [frame]
                duration=100
                image={REACTION_IMAGE}
                halo=halo/elven/elven-shield-halo-100pct.png
            [/frame]
        [/else]
        [frame]
            duration=50
            image={REACTION_IMAGE}
            halo=halo/elven/elven-shield-halo-80pct.png
        [/frame]
        [frame]
            duration=25
            image={BASE_IMAGE}
            halo=halo/elven/elven-shield-halo-60pct.png
        [/frame]
        [frame]
            duration=25
            image={BASE_IMAGE}
            halo=halo/elven/elven-shield-halo-40pct.png
        [/frame]
        [frame]
            duration=25
            image={BASE_IMAGE}
            halo=halo/elven/elven-shield-halo-20pct.png
        [/frame]
    [/defend]
#enddef

# this macro is called on top of every idle animation,
# to provide a standard set of conditions to play the idle animation

#define STANDARD_IDLE_FILTER
    # Poisoned units should have no idle animation.
    [filter]
        [not]
            [filter_wml]
                [status]
                    poisoned="yes"
                [/status]
            [/filter_wml]
        [/not]
    [/filter]
    # Units next to enemies should not have idle animations
    [filter]
        [filter_adjacent]
            is_enemy="yes"
            count=0
        [/filter_adjacent]
    [/filter]
#enddef

#define DRAKE_FLYING_ANIM STANDING_IMAGE FLYING_IMAGE
    [standing_anim]
        start_time=0
        [filter]
            [filter_location]
                terrain_type=!,W*,Qx*,Ql*
                [or]
                    terrain_type=Wwf,Wwr,*^V*
                [/or]
            [/filter_location]
        [/filter]
        [frame]
            duration=150
            image={STANDING_IMAGE}
        [/frame]
    [/standing_anim]

    [standing_anim]
        start_time=0
        layer=60
        submerge=0.01
        [filter]
            [filter_location]
                terrain_type=W*,Qx*,Ql*
                [not]
                    terrain_type=Wwf,Wwr,*^V*
                [/not]
            [/filter_location]
        [/filter]
        [frame]
            duration=150
            image={FLYING_IMAGE}
        [/frame]
    [/standing_anim]
#enddef

#define MISSILE_FRAME_WAIL
    # Animate a projectile for a wail attack.
    [if]
        direction=n,ne,nw

        [missile_frame]
            begin=-300
            end=-230
            image="projectiles/wailprojectile-n-1.png"
            image_diagonal="projectiles/wailprojectile-ne-1.png"
        [/missile_frame]
        [missile_frame]
            begin=-230
            end=-160
            image="projectiles/wailprojectile-n-2.png"
            image_diagonal="projectiles/wailprojectile-ne-2.png"
        [/missile_frame]
        [missile_frame]
            begin=-160
            end=0
            image="projectiles/wailprojectile-n-3.png"
            image_diagonal="projectiles/wailprojectile-ne-3.png"
        [/missile_frame]
        [missile_frame]
            begin=0
            end=40
            image="projectiles/wailprojectile-n-4.png"
            image_diagonal="projectiles/wailprojectile-ne-4.png"
        [/missile_frame]
        [missile_frame]
            begin=40
            end=80
            image="projectiles/wailprojectile-n-5.png"
            image_diagonal="projectiles/wailprojectile-ne-5.png"
        [/missile_frame]
        [missile_frame]
            begin=80
            end=120
            image="projectiles/wailprojectile-n-6.png"
            image_diagonal="projectiles/wailprojectile-ne-6.png"
        [/missile_frame]
    [/if]
    [else]
        direction=s,se,sw
        ### The price of asymmetrical projectiles - here, we use a conditional because the game automatically flips the images for the south frame.  We have a separate set of images for the south part, which are not only flipped vertically, but also have their angle corrected for the sw direction.

        [missile_frame]
            begin=-300
            end=-230
            image="projectiles/wailprojectile-s-1.png"
            image_diagonal="projectiles/wailprojectile-se-1.png"
        [/missile_frame]
        [missile_frame]
            begin=-230
            end=-160
            image="projectiles/wailprojectile-s-2.png"
            image_diagonal="projectiles/wailprojectile-se-2.png"
        [/missile_frame]
        [missile_frame]
            begin=-160
            end=0
            image="projectiles/wailprojectile-s-3.png"
            image_diagonal="projectiles/wailprojectile-se-3.png"
        [/missile_frame]
        [missile_frame]
            begin=0
            end=40
            image="projectiles/wailprojectile-s-4.png"
            image_diagonal="projectiles/wailprojectile-se-4.png"
        [/missile_frame]
        [missile_frame]
            begin=40
            end=80
            image="projectiles/wailprojectile-s-5.png"
            image_diagonal="projectiles/wailprojectile-se-5.png"
        [/missile_frame]
        [missile_frame]
            begin=80
            end=120
            image="projectiles/wailprojectile-s-6.png"
            image_diagonal="projectiles/wailprojectile-se-6.png"
        [/missile_frame]
    [/else]
#enddef

#define MISSILE_FRAME_LIGHT_BEAM
    # Animate a beam of light coming down from the heavens.

    missile_start_time=-245

    [if]
        direction=n,ne,nw

        [missile_frame]
            duration=30
            halo="halo/holy/light-beam-1.png"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=30
            halo="halo/holy/light-beam-2.png"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=30
            halo="halo/holy/light-beam-3.png"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=30
            halo="halo/holy/light-beam-4.png"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=30
            halo="halo/holy/light-beam-5.png"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=30
            halo="halo/holy/light-beam-6.png"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=130
            halo="halo/holy/light-beam-7.png"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=70
            halo="halo/holy/light-beam-6.png"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=70
            halo="halo/holy/light-beam-5.png"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=70
            halo="halo/holy/light-beam-4.png"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=70
            halo="halo/holy/light-beam-3.png"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=70
            halo="halo/holy/light-beam-2.png"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=70
            halo="halo/holy/light-beam-1.png"
            offset=1.0
        [/missile_frame]
    [/if]
    [else]
        direction=s,se,sw

        [missile_frame]
            duration=30
            halo="halo/holy/light-beam-1.png~FL(vert)"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=30
            halo="halo/holy/light-beam-2.png~FL(vert)"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=30
            halo="halo/holy/light-beam-3.png~FL(vert)"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=30
            halo="halo/holy/light-beam-4.png~FL(vert)"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=30
            halo="halo/holy/light-beam-5.png~FL(vert)"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=30
            halo="halo/holy/light-beam-6.png~FL(vert)"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=130
            halo="halo/holy/light-beam-7.png~FL(vert)"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=70
            halo="halo/holy/light-beam-6.png~FL(vert)"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=70
            halo="halo/holy/light-beam-5.png~FL(vert)"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=70
            halo="halo/holy/light-beam-4.png~FL(vert)"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=70
            halo="halo/holy/light-beam-3.png~FL(vert)"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=70
            halo="halo/holy/light-beam-2.png~FL(vert)"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=70
            halo="halo/holy/light-beam-1.png~FL(vert)"
            offset=1.0
        [/missile_frame]
    [/else]
#enddef

#define MISSILE_FRAME_FIRE_BREATH N_OFFSET_POSITION S_OFFSET_POSITION N_DIAGONAL_OFFSET_POSITION S_DIAGONAL_OFFSET_POSITION
    # Animate a projectile for a fire-breath attack.
    [if]
        direction=n

        [missile_frame]
            begin=-400
            end=100
            halo=projectiles/fire-breath-n-1.png:80,projectiles/fire-breath-n-2.png:80,projectiles/fire-breath-n-3.png:80,projectiles/fire-breath-n-4.png:80,projectiles/fire-breath-n-5.png:80
            halo_x,halo_y={N_OFFSET_POSITION}
        [/missile_frame]
    [/if]
    [else]
        direction=s

        [missile_frame]
            begin=-400
            end=100
            halo=projectiles/fire-breath-s-1.png:80,projectiles/fire-breath-s-2.png:80,projectiles/fire-breath-s-3.png:80,projectiles/fire-breath-s-4.png:80,projectiles/fire-breath-s-5.png:80
            halo_x,halo_y={S_OFFSET_POSITION}
        [/missile_frame]
    [/else]
    [else]
        direction=ne,nw

        [missile_frame]
            begin=-400
            end=100
            halo=projectiles/fire-breath-ne-1.png:80,projectiles/fire-breath-ne-2.png:80,projectiles/fire-breath-ne-3.png:80,projectiles/fire-breath-ne-4.png:80,projectiles/fire-breath-ne-5.png:80
            halo_x,halo_y={N_DIAGONAL_OFFSET_POSITION}
        [/missile_frame]
    [/else]
    [else]
        direction=se,sw

        [missile_frame]
            begin=-400
            end=100
            halo=projectiles/fire-breath-se-1.png:80,projectiles/fire-breath-se-2.png:80,projectiles/fire-breath-se-3.png:80,projectiles/fire-breath-se-4.png:80,projectiles/fire-breath-se-5.png:80
            halo_x,halo_y={S_DIAGONAL_OFFSET_POSITION}
        [/missile_frame]
    [/else]
#enddef

#define MISSILE_FRAME_FIRE_BREATH_N OFFSET_POSITION
    # Animate a projectile for a fire-breath attack.
    [missile_frame]
        begin=-400
        end=100
        halo=projectiles/fire-breath-n-1.png:80,projectiles/fire-breath-n-2.png:80,projectiles/fire-breath-n-3.png:80,projectiles/fire-breath-n-4.png:80,projectiles/fire-breath-n-5.png:80
        halo_x,halo_y={OFFSET_POSITION}
    [/missile_frame]
#enddef

#define MISSILE_FRAME_FIRE_BREATH_S OFFSET_POSITION
    # Animate a projectile for a fire-breath attack.
    [missile_frame]
        begin=-400
        end=100
        halo=projectiles/fire-breath-s-1.png:80,projectiles/fire-breath-s-2.png:80,projectiles/fire-breath-s-3.png:80,projectiles/fire-breath-s-4.png:80,projectiles/fire-breath-s-5.png:80
        halo_x,halo_y={OFFSET_POSITION}
    [/missile_frame]
#enddef

#define MISSILE_FRAME_FIRE_BREATH_N_DIAGONAL OFFSET_POSITION
    # Animate a projectile for a fire-breath attack.
    [missile_frame]
        begin=-400
        end=100
        halo=projectiles/fire-breath-ne-1.png:80,projectiles/fire-breath-ne-2.png:80,projectiles/fire-breath-ne-3.png:80,projectiles/fire-breath-ne-4.png:80,projectiles/fire-breath-ne-5.png:80
        halo_x,halo_y={OFFSET_POSITION}
    [/missile_frame]
#enddef

#define MISSILE_FRAME_FIRE_BREATH_S_DIAGONAL OFFSET_POSITION
    # Animate a projectile for a fire-breath attack.
    [missile_frame]
        begin=-400
        end=100
        halo=projectiles/fire-breath-se-1.png:80,projectiles/fire-breath-se-2.png:80,projectiles/fire-breath-se-3.png:80,projectiles/fire-breath-se-4.png:80,projectiles/fire-breath-se-5.png:80
        halo_x,halo_y={OFFSET_POSITION}
    [/missile_frame]
#enddef

#define MISSILE_FRAME_FAERIE_FIRE
    # Animate a projectile for a faerie-fire attack.
    [missile_frame]
        begin=-500
        end=-350
        image="projectiles/icemissile-n-1.png"
        image_diagonal="projectiles/icemissile-ne-1.png"
        halo=halo/elven/ice-halo1.png:100,halo/elven/ice-halo2.png:100,halo/elven/ice-halo3.png:25
        halo_x,halo_y=0,0
    [/missile_frame]
    [missile_frame]
        begin=-350
        end=-200
        image="projectiles/icemissile-n-2.png"
        image_diagonal="projectiles/icemissile-ne-2.png"
        halo=halo/elven/ice-halo3.png:75,halo/elven/ice-halo4.png:75
        halo_x,halo_y=0,0
    [/missile_frame]
    [missile_frame]
        begin=-200
        end=-50
        image="projectiles/icemissile-n-3.png"
        image_diagonal="projectiles/icemissile-ne-3.png"
        halo=halo/elven/ice-halo5.png:100,halo/elven/ice-halo1.png:100,halo/elven/ice-halo2.png:50
        halo_x,halo_y=0,0
    [/missile_frame]
    [missile_frame]
        begin=-50
        end=0
        image="projectiles/icemissile-n-4.png"
        image_diagonal="projectiles/icemissile-ne-4.png"
        halo=halo/elven/ice-halo6.png
        halo_x,halo_y=0,0
    [/missile_frame]
    [missile_frame]
        begin=25
        end=75
        image="projectiles/icemissile-n-5.png"
        image_diagonal="projectiles/icemissile-ne-5.png"
        halo=halo/elven/ice-halo7.png
        halo_x,halo_y=0,0
    [/missile_frame]
    [missile_frame]
        begin=75
        end=125
        image="projectiles/icemissile-n-6.png"
        image_diagonal="projectiles/icemissile-ne-6.png"
        halo=halo/elven/ice-halo8.png
        halo_x,halo_y=0,0
    [/missile_frame]
    [missile_frame]
        begin=125
        end=175
        image="projectiles/icemissile-n-7.png"
        image_diagonal="projectiles/icemissile-ne-7.png"
        halo=halo/elven/ice-halo9.png
        halo_x,halo_y=0,0
    [/missile_frame]
#enddef

#define MISSILE_FRAME_FIREBALL
    # Animate a projectile for a fireball attack.

    missile_start_time=-350

    [if]
        direction=n,ne,nw
        hits=yes

        [missile_frame]
            duration=40
            image="projectiles/fireball-n-1.png"
            image_diagonal="projectiles/fireball-nw-1.png"
            offset=0.0~0.10
        [/missile_frame]
        [missile_frame]
            duration=100
            image="projectiles/fireball-n-2.png"
            image_diagonal="projectiles/fireball-nw-2.png"
            offset=0.1~0.30
        [/missile_frame]
        [missile_frame]
            duration=125
            image="projectiles/fireball-n.png"
            image_diagonal="projectiles/fireball-nw.png"
            offset=0.3~0.60
        [/missile_frame]
        [missile_frame]
            duration=55
            image="projectiles/fireball-n-2.png"
            image_diagonal="projectiles/fireball-nw-2.png"
            offset=0.7~0.8
        [/missile_frame]
        [missile_frame]
            duration=30
            image="projectiles/fireball-n-1.png"
            image_diagonal="projectiles/fireball-nw-1.png"
            offset=0.8~0.9
        [/missile_frame]

        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-1.png"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-2.png"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-3.png"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-4.png"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-5.png"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-6.png"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-7.png"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-8.png"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-9.png"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-10.png"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-11.png"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-12.png"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-13.png"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-14.png"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-15.png"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-16.png"
            offset=1.0
        [/missile_frame]
    [/if]
    [else]
        direction=s,se,sw
        hits=yes

        [missile_frame]
            duration=40
            image="projectiles/fireball-n-1.png"
            image_diagonal="projectiles/fireball-nw-1.png"
            offset=0.0~0.10
        [/missile_frame]
        [missile_frame]
            duration=100
            image="projectiles/fireball-n-2.png"
            image_diagonal="projectiles/fireball-nw-2.png"
            offset=0.1~0.30
        [/missile_frame]
        [missile_frame]
            duration=125
            image="projectiles/fireball-n.png"
            image_diagonal="projectiles/fireball-nw.png"
            offset=0.3~0.60
        [/missile_frame]
        [missile_frame]
            duration=55
            image="projectiles/fireball-n-2.png"
            image_diagonal="projectiles/fireball-nw-2.png"
            offset=0.7~0.8
        [/missile_frame]
        [missile_frame]
            duration=30
            image="projectiles/fireball-n-1.png"
            image_diagonal="projectiles/fireball-nw-1.png"
            offset=0.8~0.9
        [/missile_frame]

        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-1.png~FL(vert)"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-2.png~FL(vert)"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-3.png~FL(vert)"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-4.png~FL(vert)"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-5.png~FL(vert)"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-6.png~FL(vert)"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-7.png~FL(vert)"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-8.png~FL(vert)"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-9.png~FL(vert)"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-10.png~FL(vert)"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-11.png~FL(vert)"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-12.png~FL(vert)"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-13.png~FL(vert)"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-14.png~FL(vert)"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-15.png~FL(vert)"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            duration=60
            halo="projectiles/fireball-impact-16.png~FL(vert)"
            offset=1.0
        [/missile_frame]
    [/else]
    [else]
        direction=n,ne,nw
        hits=no

        missile_offset=0.0~0.20,0.20~0.35,0.35~0.40,0.4~0.45

        [missile_frame]
            duration=100
            halo="projectiles/fireball-fail-1.png"
        [/missile_frame]
        [missile_frame]
            duration=100
            halo="projectiles/fireball-fail-2.png"
        [/missile_frame]
        [missile_frame]
            duration=100
            halo="projectiles/fireball-fail-3.png"
        [/missile_frame]
        [missile_frame]
            duration=100
            halo="projectiles/fireball-fail-4.png"
        [/missile_frame]
        [missile_frame]
            duration=100
            halo="projectiles/fireball-fail-5.png"
        [/missile_frame]
        [missile_frame]
            duration=100
            halo="projectiles/fireball-fail-6.png"
        [/missile_frame]
        [missile_frame]
            duration=100
            halo="projectiles/fireball-fail-7.png"
        [/missile_frame]
    [/else]
    [else]
        direction=s,se,sw
        hits=no

        missile_offset=0.0~0.20,0.20~0.35,0.35~0.40,0.4~0.45

        [missile_frame]
            duration=100
            halo="projectiles/fireball-fail-1.png~FL(vert)"
        [/missile_frame]
        [missile_frame]
            duration=100
            halo="projectiles/fireball-fail-2.png~FL(vert)"
        [/missile_frame]
        [missile_frame]
            duration=100
            halo="projectiles/fireball-fail-3.png~FL(vert)"
        [/missile_frame]
        [missile_frame]
            duration=100
            halo="projectiles/fireball-fail-4.png~FL(vert)"
        [/missile_frame]
        [missile_frame]
            duration=100
            halo="projectiles/fireball-fail-5.png~FL(vert)"
        [/missile_frame]
        [missile_frame]
            duration=100
            halo="projectiles/fireball-fail-6.png~FL(vert)"
        [/missile_frame]
        [missile_frame]
            duration=100
            halo="projectiles/fireball-fail-7.png~FL(vert)"
        [/missile_frame]
    [/else]
#enddef

#define HALO_FRAME_SAURIAN
    halo_auto_vflip=false
    [halo_frame]
        duration=60
        halo=halo/saurian-magic-halo-1.png
    [/halo_frame]
    [halo_frame]
        duration=60
        halo=halo/saurian-magic-halo-2.png
    [/halo_frame]
    [halo_frame]
        duration=60
        halo=halo/saurian-magic-halo-3.png
    [/halo_frame]
    [halo_frame]
        duration=60
        halo=halo/saurian-magic-halo-4.png
    [/halo_frame]
    [halo_frame]
        duration=60
        halo=halo/saurian-magic-halo-5.png
    [/halo_frame]
    [halo_frame]
        duration=60
        halo=halo/saurian-magic-halo-6.png
    [/halo_frame]
    [halo_frame]
        duration=60
        halo=halo/saurian-magic-halo-7.png
    [/halo_frame]
#enddef

#define MISSILE_FRAME_ICE
    [if]
        hits=yes
        [missile_frame]
            begin=-200
            end=0
            image="projectiles/whitemissile-n.png"
            image_diagonal="projectiles/whitemissile-ne.png"
            sound=magicmissile.wav
            offset=0.0~0.8
        [/missile_frame]
        [missile_frame]
            begin=0
            end=50
            halo="projectiles/whitemissile-impact-1.png"
            offset=0.8
        [/missile_frame]
        [missile_frame]
            begin=50
            end=100
            halo="projectiles/whitemissile-impact-2.png"
            offset=0.92
        [/missile_frame]
        [missile_frame]
            begin=100
            end=150
            halo="projectiles/whitemissile-impact-3.png"
            offset=0.94
        [/missile_frame]
        [missile_frame]
            begin=150
            end=200
            halo="projectiles/whitemissile-impact-4.png"
            offset=0.96
        [/missile_frame]
        [missile_frame]
            begin=200
            end=250
            halo="projectiles/whitemissile-impact-5.png"
            offset=0.98
        [/missile_frame]
        [missile_frame]
            begin=250
            end=300
            halo="projectiles/whitemissile-impact-6.png"
            offset=1.0
        [/missile_frame]
        [missile_frame]
            begin=300
            end=350
            halo="projectiles/whitemissile-impact-7.png"
            offset=1.02
        [/missile_frame]
        [missile_frame]
            begin=350
            end=400
            halo="projectiles/whitemissile-impact-8.png"
            offset=1.04
        [/missile_frame]
    [/if]
    [else]
        hits=no
        [missile_frame]
            begin=-200
            end=0
            image="projectiles/whitemissile-n.png"
            image_diagonal="projectiles/whitemissile-ne.png"
            sound=magicmissile.wav
            offset=0.0~0.8
            alpha=.8~0.0:200
        [/missile_frame]
    [/else]
#enddef

#define MISSILE_FRAME_HATCHET
    # Animate a projectile for a thrown-hatchet attack.
    [missile_frame]
        begin=-200
        end=-150
        image="projectiles/hatchet-2.png"
        image_diagonal="projectiles/hatchet-2.png"
    [/missile_frame]
    [missile_frame]
        begin=-150
        end=-100
        image="projectiles/hatchet-3.png"
        image_diagonal="projectiles/hatchet-3.png"
    [/missile_frame]
    [missile_frame]
        begin=-100
        end=-50
        image="projectiles/hatchet-4.png"
        image_diagonal="projectiles/hatchet-4.png"
    [/missile_frame]
    [missile_frame]
        begin=-50
        end=0
        image="projectiles/hatchet-1.png"
        image_diagonal="projectiles/hatchet-1.png"
    [/missile_frame]
#enddef

#define FIRE_BURST_SMALL
    [missile_frame]
        begin=0
        end=75
        image="projectiles/fire-burst-small-1.png"
        image_diagonal="projectiles/fire-burst-small-1.png"
        offset=0.8
    [/missile_frame]
    [missile_frame]
        begin=75
        end=150
        image="projectiles/fire-burst-small-2.png"
        image_diagonal="projectiles/fire-burst-small-2.png"
        offset=0.83
    [/missile_frame]
    [missile_frame]
        begin=150
        end=225
        image="projectiles/fire-burst-small-3.png"
        image_diagonal="projectiles/fire-burst-small-3.png"
        offset=0.86
    [/missile_frame]
    [missile_frame]
        begin=225
        end=300
        image="projectiles/fire-burst-small-4.png"
        image_diagonal="projectiles/fire-burst-small-4.png"
        offset=0.89
    [/missile_frame]
    [missile_frame]
        begin=300
        end=375
        image="projectiles/fire-burst-small-5.png"
        image_diagonal="projectiles/fire-burst-small-5.png"
        offset=0.92
    [/missile_frame]
    [missile_frame]
        begin=375
        end=450
        image="projectiles/fire-burst-small-6.png"
        image_diagonal="projectiles/fire-burst-small-6.png"
        offset=0.95
    [/missile_frame]
    [missile_frame]
        begin=450
        end=525
        image="projectiles/fire-burst-small-7.png"
        image_diagonal="projectiles/fire-burst-small-7.png"
        offset=0.98
    [/missile_frame]
    [missile_frame]
        begin=525
        end=600
        image="projectiles/fire-burst-small-8.png"
        image_diagonal="projectiles/fire-burst-small-8.png"
        offset=1.0
    [/missile_frame]
#enddef

#define LIGHTNING_BOLT DIRECTION_NUMBER
    [if]
        direction=sw,s,se

        [missile_frame]
            begin=-250
            end=150
            halo=halo/lightning-bolt-{DIRECTION_NUMBER}-1.png~FL(vert):100,halo/lightning-bolt-{DIRECTION_NUMBER}-2.png~FL(vert):100,halo/lightning-bolt-{DIRECTION_NUMBER}-3.png~FL(vert):100,halo/lightning-bolt-{DIRECTION_NUMBER}-4.png~FL(vert):100
            halo_y=-125
            offset=1.0
        [/missile_frame]
    [/if]
    [else]
        direction=nw,n,ne

        [missile_frame]
            begin=-250
            end=150
            halo=halo/lightning-bolt-{DIRECTION_NUMBER}-1.png:100,halo/lightning-bolt-{DIRECTION_NUMBER}-2.png:100,halo/lightning-bolt-{DIRECTION_NUMBER}-3.png:100,halo/lightning-bolt-{DIRECTION_NUMBER}-4.png:100
            halo_y=-125
            offset=1.0
        [/missile_frame]
    [/else]
#enddef

#define MAGIC_MISSILE OFFSET_X OFFSET_Y
    magic_missile_start_time=-750

    magic_missile_trail_1_start_time=-350
    magic_missile_trail_2_start_time=-350
    magic_missile_trail_3_start_time=-350

    [magic_missile_frame]
        duration=400
        halo=halo/mage-halo1.png,halo/mage-halo2.png,halo/mage-halo3.png,halo/mage-halo4.png,halo/mage-halo5.png
        halo_x={OFFSET_X}~0
        halo_y={OFFSET_Y}~-54
        offset=0.001~-0.083,-0.083~-0.25,-0.25~-0.5
    [/magic_missile_frame]
    [magic_missile_frame]
        duration=350
        halo=halo/mage-halo1.png,halo/mage-halo2.png,halo/mage-halo3.png,halo/mage-halo4.png,halo/mage-halo5.png,misc/blank-hex.png:1
        halo_y=-54~-45,-45~-27,-27~0
        offset=-0.5~-0.25,-0.25~0.25,0.25~1.0
    [/magic_missile_frame]

    [magic_missile_trail_1_frame]
        duration=350
        halo=misc/blank-hex.png:40,halo/mage-preparation-halo1.png,halo/mage-preparation-halo2.png,halo/mage-preparation-halo3.png,halo/mage-preparation-halo4.png,halo/mage-preparation-halo5.png,halo/mage-preparation-halo6.png,halo/mage-preparation-halo7.png,misc/blank-hex.png:1
        halo_y=-54:40,-54~-45,-45~-27,-27~0
        offset=0.001:40,-0.5~-0.25,-0.25~0.25,0.25~1.0
    [/magic_missile_trail_1_frame]
    [magic_missile_trail_2_frame]
        duration=350
        halo=misc/blank-hex.png:80,halo/mage-preparation-halo1.png,halo/mage-preparation-halo2.png,halo/mage-preparation-halo3.png,halo/mage-preparation-halo4.png,halo/mage-preparation-halo5.png,halo/mage-preparation-halo6.png,halo/mage-preparation-halo7.png,misc/blank-hex.png:1
        halo_y=-54:80,-54~-45,-45~-27,-27~0
        offset=0.001:80,-0.5~-0.25,-0.25~0.25,0.25~1.0
    [/magic_missile_trail_2_frame]
    [magic_missile_trail_3_frame]
        duration=350
        halo=misc/blank-hex.png:120,halo/mage-preparation-halo1.png,halo/mage-preparation-halo2.png,halo/mage-preparation-halo3.png,halo/mage-preparation-halo4.png,halo/mage-preparation-halo5.png,halo/mage-preparation-halo6.png,halo/mage-preparation-halo7.png,misc/blank-hex.png:1
        halo_y=-54:120,-54~-45,-45~-27,-27~0
        offset=0.001:120,-0.5~-0.25,-0.25~0.25,0.25~1.0
    [/magic_missile_trail_3_frame]
#enddef

#define MAGIC_MISSILE_STAFF_FLARE START_TIME DURATION_TIME OFFSET_X OFFSET_Y
    magic_missile_flare_start_time={START_TIME}

    [magic_missile_flare_frame]
        duration={DURATION_TIME}
        halo=halo/mage-preparation-halo1.png,halo/mage-preparation-halo2.png,halo/mage-preparation-halo3.png,halo/mage-preparation-halo4.png,halo/mage-preparation-halo5.png,halo/mage-preparation-halo6.png,halo/mage-preparation-halo7.png,misc/blank-hex.png:1
        halo_x={OFFSET_X}
        halo_y={OFFSET_Y}
        offset=0
    [/magic_missile_flare_frame]
#enddef

#define MERMAID_STAFF_FLARE OFFSET_X OFFSET_Y
    flare_start_time=-420
    [flare_frame]
        duration=60
        halo=halo/merfolk/staff-flare-1.png
        halo_x,halo_y={OFFSET_X},{OFFSET_Y}
    [/flare_frame]
    [flare_frame]
        duration=60
        halo=halo/merfolk/staff-flare-2.png
        halo_x,halo_y={OFFSET_X},{OFFSET_Y}
    [/flare_frame]
    [flare_frame]
        duration=60
        halo=halo/merfolk/staff-flare-3.png
        halo_x,halo_y={OFFSET_X},{OFFSET_Y}
    [/flare_frame]
    [flare_frame]
        duration=60
        halo=halo/merfolk/staff-flare-4.png
        halo_x,halo_y={OFFSET_X},{OFFSET_Y}
    [/flare_frame]
    [flare_frame]
        duration=60
        halo=halo/merfolk/staff-flare-5.png
        halo_x,halo_y={OFFSET_X},{OFFSET_Y}
    [/flare_frame]
    [flare_frame]
        duration=60
        halo=halo/merfolk/staff-flare-6.png
        halo_x,halo_y={OFFSET_X},{OFFSET_Y}
    [/flare_frame]
    [flare_frame]
        duration=60
        halo=halo/merfolk/staff-flare-7.png
        halo_x,halo_y={OFFSET_X},{OFFSET_Y}
    [/flare_frame]
    [flare_frame]
        duration=10
    [/flare_frame]
#enddef

#define MERMAID_WATER_BLAST_HALO
    water_start_time=-420
    [water_frame]
        duration=60
        halo=halo/merfolk/water-halo-1.png
    [/water_frame]
    [water_frame]
        duration=60
        halo=halo/merfolk/water-halo-2.png
    [/water_frame]
    [water_frame]
        duration=60
        halo=halo/merfolk/water-halo-3.png
    [/water_frame]
    [water_frame]
        duration=60
        halo=halo/merfolk/water-halo-4.png
    [/water_frame]
    [water_frame]
        duration=60
        halo=halo/merfolk/water-halo-5.png
    [/water_frame]
    [water_frame]
        duration=60
        halo=halo/merfolk/water-halo-6.png
    [/water_frame]
    [water_frame]
        duration=60
        halo=halo/merfolk/water-halo-7.png
    [/water_frame]
    [water_frame]
        duration=10
    [/water_frame]
#enddef

#define MISSILE_FRAME_MUZZLE_FLARE_MISS
    missile_start_time=-250
    missile_offset=0.1
    [missile_frame]
        duration=100
        halo="projectiles/misfire-spark-1.png"
    [/missile_frame]
    [missile_frame]
        duration=100
        halo="projectiles/misfire-spark-2.png"
    [/missile_frame]
    [missile_frame]
        duration=100
        halo="projectiles/misfire-spark-3.png"
    [/missile_frame]
    [missile_frame]
        duration=100
        halo="projectiles/misfire-spark-4.png"
    [/missile_frame]
#enddef
#define MISSILE_FRAME_MUZZLE_FLARE_HIT_NORTH START_X START_Y
    missile_start_time=-250
    missile_offset=0.5~1.1:250,1.1~1.5:200,1.5~1.7:360
    missile_halo_x={START_X}~0
    missile_halo_y={START_Y}~0
    [missile_frame]
        duration=100
        halo="projectiles/muzzle-flash-n-1.png"
    [/missile_frame]
    [missile_frame]
        duration=80
        halo="projectiles/muzzle-flash-n-2.png"
    [/missile_frame]
    [missile_frame]
        duration=70
        halo="projectiles/muzzle-flash-n-3.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-4.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-5.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-6.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-7.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-8.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-9.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-10.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-11.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-12.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-13.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-14.png"
    [/missile_frame]
#enddef
#define MISSILE_FRAME_MUZZLE_FLARE_HIT_SOUTH START_X START_Y
    missile_start_time=-250
    missile_offset=0.5~1.1:250,1.1~1.5:200,1.5~1.7:360
    missile_halo_x={START_X}~0
    missile_halo_y={START_Y}~0
    [missile_frame]
        duration=100
        halo="projectiles/muzzle-flash-s-1.png~FL(vertical)"
    [/missile_frame]
    [missile_frame]
        duration=80
        halo="projectiles/muzzle-flash-s-2.png~FL(vertical)"
    [/missile_frame]
    [missile_frame]
        duration=70
        halo="projectiles/muzzle-flash-s-3.png~FL(vertical)"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-4.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-5.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-6.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-7.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-8.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-9.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-10.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-11.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-12.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-13.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-14.png"
    [/missile_frame]
#enddef
#define MISSILE_FRAME_MUZZLE_FLARE_HIT_DIAG_NORTH START_X START_Y
    missile_start_time=-250
    missile_offset=0.5~1.1:250,1.1~1.5:200,1.5~1.7:360
    missile_halo_x={START_X}~0
    missile_halo_y={START_Y}~0
    [missile_frame]
        duration=100
        halo="projectiles/muzzle-flash-ne-1.png"
    [/missile_frame]
    [missile_frame]
        duration=80
        halo="projectiles/muzzle-flash-ne-2.png"
    [/missile_frame]
    [missile_frame]
        duration=70
        halo="projectiles/muzzle-flash-ne-3.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-4.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-5.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-6.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-7.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-8.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-9.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-10.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-11.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-12.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-13.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-14.png"
    [/missile_frame]
#enddef
#define MISSILE_FRAME_MUZZLE_FLARE_HIT_DIAG_SOUTH START_X START_Y
    missile_start_time=-250
    missile_offset=0.5~1.1:250,1.1~1.5:200,1.5~1.7:360
    missile_halo_x={START_X}~0
    missile_halo_y={START_Y}~0
    [missile_frame]
        duration=100
        halo="projectiles/muzzle-flash-se-1.png~FL(vertical)"
    [/missile_frame]
    [missile_frame]
        duration=80
        halo="projectiles/muzzle-flash-se-2.png~FL(vertical)"
    [/missile_frame]
    [missile_frame]
        duration=70
        halo="projectiles/muzzle-flash-se-3.png~FL(vertical)"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-4.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-5.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-6.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-7.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-8.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-9.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-10.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-11.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-12.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-13.png"
    [/missile_frame]
    [missile_frame]
        duration=60
        halo="projectiles/muzzle-flash-14.png"
    [/missile_frame]
#enddef

#define MISSILE_FRAME_STONE_HIT OFFSET_X OFFSET_Y
    [sling_stone_frame]
        begin=-201
        end=-200
        image="misc/blank-hex.png"
    [/sling_stone_frame]
    [sling_stone_frame]
        begin=-200
        end=0
        halo="projectiles/stone.png"
        halo_x={OFFSET_X}~0
        halo_y={OFFSET_Y}~0
        y=0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0
        offset=0.0~1.0
    [/sling_stone_frame]
    [sling_stone_frame]
        begin=0
        end=1
        image="misc/blank-hex.png"
    [/sling_stone_frame]
#enddef

#define MISSILE_FRAME_STONE_MISS OFFSET_X OFFSET_Y
    [sling_stone_frame]
        begin=-201
        end=-200
        image="misc/blank-hex.png"
    [/sling_stone_frame]
    [sling_stone_frame]
        begin=-200
        end=100
        halo="projectiles/stone.png"
        halo_x={OFFSET_X}~0
        halo_y={OFFSET_Y}~0
        y=0~-5,-5~-8,-8~-9,-9~-10,-10~-9,-9~-8,-8~-5,-5~0
        offset=0.0~1.5
    [/sling_stone_frame]
    [sling_stone_frame]
        begin=100
        end=101
        image="misc/blank-hex.png"
    [/sling_stone_frame]
#enddef

#define DRAKE_UNWALKABLE_TERRAINS
!,Wwf,*^B*,!,W*,W*^V*,Chs,Chw,S*,S*^V*,Q*#enddef

#define DRAKE_STANDING_ANIM DRAKE_NAME
    [standing_anim]
        [frame]
            image="units/drakes/{DRAKE_NAME}.png"
            duration=50
        [/frame]
    [/standing_anim]
    [standing_anim]
        start_time=0
        terrain_type={DRAKE_UNWALKABLE_TERRAINS}
        submerge=0.01
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fly-1.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fly-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fly-3.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fly-4.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fly-5.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fly-4.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fly-3-upstroke.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fly-2-upstroke.png"
        [/frame]
    [/standing_anim]
    [pre_movement_anim]
        start_time=0
        terrain_type=!,{DRAKE_UNWALKABLE_TERRAINS}
        [frame]
            duration=50
            image="units/drakes/{DRAKE_NAME}-takeoff-1.png"
        [/frame]
        [frame]
            duration=50
            image="units/drakes/{DRAKE_NAME}-takeoff-2.png"
        [/frame]
        [frame]
            duration=50
            image="units/drakes/{DRAKE_NAME}-takeoff-3.png"
        [/frame]
        [frame]
            duration=50
            image="units/drakes/{DRAKE_NAME}-takeoff-4.png"
        [/frame]
    [/pre_movement_anim]
    [movement_anim]
        start_time=0
        submerge=0.01
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fly-1.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fly-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fly-3.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fly-4.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fly-5.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fly-4.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fly-3-upstroke.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fly-2-upstroke.png"
        [/frame]
    [/movement_anim]
    [post_movement_anim]
        terrain_type=!,{DRAKE_UNWALKABLE_TERRAINS}
        start_time=0
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-takeoff-4.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-takeoff-3.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-takeoff-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-takeoff-1.png"
        [/frame]
    [/post_movement_anim]
#enddef

#define DRAKE_FIRE_ANIM DRAKE_NAME DIRECTION_SUFFIX DIRECTION OFFSET_X OFFSET_Y
    [attack_anim]
        [filter_attack]
            name=fire breath
        [/filter_attack]
        direction={DIRECTION}
        hits=yes

        offset=0.0

        impact_burst_start_time=-160
        [impact_burst_frame]
            duration=320
            halo=misc/blank-hex.png:1,projectiles/fire-burst-small-1.png:39,projectiles/fire-burst-small-2.png:40,projectiles/fire-burst-small-3.png:40,projectiles/fire-burst-small-4.png:40,projectiles/fire-burst-small-5.png:40,projectiles/fire-burst-small-6.png:40,projectiles/fire-burst-small-7.png:40,projectiles/fire-burst-small-8.png:39,misc/blank-hex.png:1
            offset=1.0
            layer=1
        [/impact_burst_frame]

        flame_trail_1_start_time=-450
        flame_trail_2_start_time=-400
        flame_trail_3_start_time=-350
        flame_trail_4_start_time=-300
        flame_trail_5_start_time=-250
        [flame_trail_1_frame]
            duration=500
            halo=misc/blank-hex.png:1,projectiles/fire-breath-1.png:49,projectiles/fire-breath-2.png:50,projectiles/fire-breath-3.png:50,projectiles/fire-breath-4.png:50,projectiles/fire-breath-5.png:50,projectiles/fire-breath-6.png:50,projectiles/fire-breath-7.png:50,projectiles/fire-breath-8.png:50,projectiles/fire-breath-9.png:50,projectiles/fire-breath-10.png:49,misc/blank-hex.png:1
            halo_x={OFFSET_X}~0:300,0
            halo_y={OFFSET_Y}~0:300,0
            offset=0.0~1.0:300,1.0~1.25:200
        [/flame_trail_1_frame]
        [flame_trail_2_frame]
            duration=500
            halo=misc/blank-hex.png:1,projectiles/fire-breath-1.png:49,projectiles/fire-breath-2.png:50,projectiles/fire-breath-3.png:50,projectiles/fire-breath-4.png:50,projectiles/fire-breath-5.png:50,projectiles/fire-breath-6.png:50,projectiles/fire-breath-7.png:50,projectiles/fire-breath-8.png:50,projectiles/fire-breath-9.png:50,projectiles/fire-breath-10.png:49,misc/blank-hex.png:1
            halo_x={OFFSET_X}~0:300,0
            halo_y={OFFSET_Y}~0:300,0
            offset=0.0~1.0:300,1.0~1.20:200
        [/flame_trail_2_frame]
        [flame_trail_3_frame]
            duration=500
            halo=misc/blank-hex.png:1,projectiles/fire-breath-1.png:49,projectiles/fire-breath-2.png:50,projectiles/fire-breath-3.png:50,projectiles/fire-breath-4.png:50,projectiles/fire-breath-5.png:50,projectiles/fire-breath-6.png:50,projectiles/fire-breath-7.png:50,projectiles/fire-breath-8.png:50,projectiles/fire-breath-9.png:50,projectiles/fire-breath-10.png:49,misc/blank-hex.png:1
            halo_x={OFFSET_X}~0:300,0
            halo_y={OFFSET_Y}~0:300,0
            offset=0.0~1.0:300,1.0~1.15:200
        [/flame_trail_3_frame]
        [flame_trail_4_frame]
            duration=500
            halo=misc/blank-hex.png:1,projectiles/fire-breath-1.png:49,projectiles/fire-breath-2.png:50,projectiles/fire-breath-3.png:50,projectiles/fire-breath-4.png:50,projectiles/fire-breath-5.png:50,projectiles/fire-breath-6.png:50,projectiles/fire-breath-7.png:50,projectiles/fire-breath-8.png:50,projectiles/fire-breath-9.png:50,projectiles/fire-breath-10.png:49,misc/blank-hex.png:1
            halo_x={OFFSET_X}~0:300,0
            halo_y={OFFSET_Y}~0:300,0
            offset=0.0~1.0:300,1.0~1.10:200
        [/flame_trail_4_frame]
        [flame_trail_5_frame]
            duration=500
            halo=misc/blank-hex.png:1,projectiles/fire-breath-1.png:49,projectiles/fire-breath-2.png:50,projectiles/fire-breath-3.png:50,projectiles/fire-breath-4.png:50,projectiles/fire-breath-5.png:50,projectiles/fire-breath-6.png:50,projectiles/fire-breath-7.png:50,projectiles/fire-breath-8.png:50,projectiles/fire-breath-9.png:50,projectiles/fire-breath-10.png:49,misc/blank-hex.png:1
            halo_x={OFFSET_X}~0:300,0
            halo_y={OFFSET_Y}~0:300,0
            offset=0.0~1.0:300,1.0~1.05:200
        [/flame_trail_5_frame]

        start_time=-900
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-inhale-1.png"
            sound=flame-big.ogg
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-inhale-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-inhale-3.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-inhale-4.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-inhale-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-{DIRECTION_SUFFIX}-1.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-{DIRECTION_SUFFIX}-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-{DIRECTION_SUFFIX}-3.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-{DIRECTION_SUFFIX}-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-{DIRECTION_SUFFIX}-1.png"
        [/frame]
    [/attack_anim]

    [attack_anim]
        [filter_attack]
            name=fire breath
        [/filter_attack]
        direction={DIRECTION}
        hits=no

        offset=0.0

        flame_trail_1_start_time=-450
        flame_trail_2_start_time=-400
        flame_trail_3_start_time=-350
        flame_trail_4_start_time=-300
        flame_trail_5_start_time=-250
        [flame_trail_1_frame]
            duration=500
            halo=misc/blank-hex.png:1,projectiles/fire-breath-1.png:49,projectiles/fire-breath-2.png:50,projectiles/fire-breath-3.png:50,projectiles/fire-breath-4.png:50,projectiles/fire-breath-5.png:50,projectiles/fire-breath-6.png:50,projectiles/fire-breath-7.png:50,projectiles/fire-breath-8.png:50,projectiles/fire-breath-9.png:50,projectiles/fire-breath-10.png:49,misc/blank-hex.png:1
            halo_x={OFFSET_X}~0:300,0
            halo_y={OFFSET_Y}~0:300,0
            offset=0.0~1.0:300,1.0~1.5:200
        [/flame_trail_1_frame]
        [flame_trail_2_frame]
            duration=500
            halo=misc/blank-hex.png:1,projectiles/fire-breath-1.png:49,projectiles/fire-breath-2.png:50,projectiles/fire-breath-3.png:50,projectiles/fire-breath-4.png:50,projectiles/fire-breath-5.png:50,projectiles/fire-breath-6.png:50,projectiles/fire-breath-7.png:50,projectiles/fire-breath-8.png:50,projectiles/fire-breath-9.png:50,projectiles/fire-breath-10.png:49,misc/blank-hex.png:1
            halo_x={OFFSET_X}~0:300,0
            halo_y={OFFSET_Y}~0:300,0
            offset=0.0~1.0:300,1.0~1.4:200
        [/flame_trail_2_frame]
        [flame_trail_3_frame]
            duration=500
            halo=misc/blank-hex.png:1,projectiles/fire-breath-1.png:49,projectiles/fire-breath-2.png:50,projectiles/fire-breath-3.png:50,projectiles/fire-breath-4.png:50,projectiles/fire-breath-5.png:50,projectiles/fire-breath-6.png:50,projectiles/fire-breath-7.png:50,projectiles/fire-breath-8.png:50,projectiles/fire-breath-9.png:50,projectiles/fire-breath-10.png:49,misc/blank-hex.png:1
            halo_x={OFFSET_X}~0:300,0
            halo_y={OFFSET_Y}~0:300,0
            offset=0.0~1.0:300,1.0~1.3:200
        [/flame_trail_3_frame]
        [flame_trail_4_frame]
            duration=500
            halo=misc/blank-hex.png:1,projectiles/fire-breath-1.png:49,projectiles/fire-breath-2.png:50,projectiles/fire-breath-3.png:50,projectiles/fire-breath-4.png:50,projectiles/fire-breath-5.png:50,projectiles/fire-breath-6.png:50,projectiles/fire-breath-7.png:50,projectiles/fire-breath-8.png:50,projectiles/fire-breath-9.png:50,projectiles/fire-breath-10.png:49,misc/blank-hex.png:1
            halo_x={OFFSET_X}~0:300,0
            halo_y={OFFSET_Y}~0:300,0
            offset=0.0~1.0:300,1.0~1.2:200
        [/flame_trail_4_frame]
        [flame_trail_5_frame]
            duration=500
            halo=misc/blank-hex.png:1,projectiles/fire-breath-1.png:49,projectiles/fire-breath-2.png:50,projectiles/fire-breath-3.png:50,projectiles/fire-breath-4.png:50,projectiles/fire-breath-5.png:50,projectiles/fire-breath-6.png:50,projectiles/fire-breath-7.png:50,projectiles/fire-breath-8.png:50,projectiles/fire-breath-9.png:50,projectiles/fire-breath-10.png:49,misc/blank-hex.png:1
            halo_x={OFFSET_X}~0:300,0
            halo_y={OFFSET_Y}~0:300,0
            offset=0.0~1.0:300,1.0~1.1:200
        [/flame_trail_5_frame]

        start_time=-900
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-inhale-1.png"
            sound=flame-big-miss.ogg
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-inhale-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-inhale-3.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-inhale-4.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-inhale-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-{DIRECTION_SUFFIX}-1.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-{DIRECTION_SUFFIX}-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-{DIRECTION_SUFFIX}-3.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-{DIRECTION_SUFFIX}-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-{DIRECTION_SUFFIX}-1.png"
        [/frame]
    [/attack_anim]
#enddef

#define DRAKE_FIRE_ANIM_S_DIAGONAL DRAKE_NAME OFFSET_POSITION
    [attack_anim]
        [filter_attack]
            name=fire breath
        [/filter_attack]
        direction=se,sw
        [missile_frame]
            begin=-400
            end=100
            halo=projectiles/fire-breath-se-1.png:80,projectiles/fire-breath-se-2.png:80,projectiles/fire-breath-se-3.png:80,projectiles/fire-breath-se-4.png:80,projectiles/fire-breath-se-5.png:80
            halo_x,halo_y={OFFSET_POSITION}
        [/missile_frame]
        start_time=-900
        [if]
            hits=no

            [frame]
                duration=20
                image="units/drakes/{DRAKE_NAME}.png"
                sound=flame-big-miss.ogg
            [/frame]
        [/if]
        [else]
            hits=yes

            [frame]
                duration=20
                image="units/drakes/{DRAKE_NAME}.png"
                sound=flame-big.ogg
            [/frame]
        [/else]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-inhale-1.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-inhale-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-inhale-3.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-inhale-4.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-inhale-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-se-1.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-se-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-se-3.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-se-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-se-1.png"
        [/frame]
    [/attack_anim]
#enddef

#define DRAKE_FIRE_ANIM_N_DIAGONAL_CURRENT DRAKE_NAME OFFSET_POSITION
    [attack_anim]
        [filter_attack]
            name=fire breath
        [/filter_attack]
        direction=ne,nw
        [missile_frame]
            begin=-400
            end=100
            halo=projectiles/fire-breath-ne-1.png:80,projectiles/fire-breath-ne-2.png:80,projectiles/fire-breath-ne-3.png:80,projectiles/fire-breath-ne-4.png:80,projectiles/fire-breath-ne-5.png:80
            halo_x,halo_y={OFFSET_POSITION}
        [/missile_frame]
        start_time=-900
        [if]
            hits=no

            [frame]
                duration=20
                image="units/drakes/{DRAKE_NAME}.png"
                sound=flame-big-miss.ogg
            [/frame]
        [/if]
        [else]
            hits=yes

            [frame]
                duration=20
                image="units/drakes/{DRAKE_NAME}.png"
                sound=flame-big.ogg
            [/frame]
        [/else]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-inhale-1.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-inhale-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-inhale-3.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-inhale-4.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-inhale-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-se-1.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-se-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-se-3.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-se-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-se-1.png"
        [/frame]
    [/attack_anim]
#enddef

#define DRAKE_FIRE_ANIM_S DRAKE_NAME OFFSET_POSITION
    [attack_anim]
        [filter_attack]
            name=fire breath
        [/filter_attack]
        direction=s
        [missile_frame]
            begin=-400
            end=100
            halo=projectiles/fire-breath-s-1.png:80,projectiles/fire-breath-s-2.png:80,projectiles/fire-breath-s-3.png:80,projectiles/fire-breath-s-4.png:80,projectiles/fire-breath-s-5.png:80
            halo_x,halo_y={OFFSET_POSITION}
        [/missile_frame]
        start_time=-900
        [if]
            hits=no

            [frame]
                duration=20
                image="units/drakes/{DRAKE_NAME}.png"
                sound=flame-big-miss.ogg
            [/frame]
        [/if]
        [else]
            hits=yes

            [frame]
                duration=20
                image="units/drakes/{DRAKE_NAME}.png"
                sound=flame-big.ogg
            [/frame]
        [/else]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-inhale-1.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-inhale-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-inhale-3.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-inhale-4.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-inhale-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-s-1.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-s-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-s-3.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-s-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-s-1.png"
        [/frame]
    [/attack_anim]
#enddef

#define DRAKE_FIRE_ANIM_N_CURRENT DRAKE_NAME OFFSET_POSITION
    [attack_anim]
        [filter_attack]
            name=fire breath
        [/filter_attack]
        direction=n
        [missile_frame]
            begin=-400
            end=100
            halo=projectiles/fire-breath-n-1.png:80,projectiles/fire-breath-n-2.png:80,projectiles/fire-breath-n-3.png:80,projectiles/fire-breath-n-4.png:80,projectiles/fire-breath-n-5.png:80
            halo_x,halo_y={OFFSET_POSITION}
        [/missile_frame]
        start_time=-900
        [if]
            hits=no

            [frame]
                duration=20
                image="units/drakes/{DRAKE_NAME}.png"
                sound=flame-big-miss.ogg
            [/frame]
        [/if]
        [else]
            hits=yes

            [frame]
                duration=20
                image="units/drakes/{DRAKE_NAME}.png"
                sound=flame-big.ogg
            [/frame]
        [/else]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-inhale-1.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-inhale-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-inhale-3.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-inhale-4.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-inhale-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-s-1.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-s-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-s-3.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-s-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fire-s-1.png"
        [/frame]
    [/attack_anim]
#enddef

#define DRAKE_MOVEMENT_ANIM DRAKE_NAME
    [movement_anim]
        start_time=0
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fly-1.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fly-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fly-3.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fly-4.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fly-5.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fly-4.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fly-3-upstroke.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-fly-2-upstroke.png"
        [/frame]
    [/movement_anim]
#enddef

#define DRAKE_WEAPON_ANIM DRAKE_NAME
    [draw_weapon_anim]
        #landing, only do it when we're not already flying
        terrain_type={DRAKE_UNWALKABLE_TERRAINS}
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-takeoff-4.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-takeoff-3.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-takeoff-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-takeoff-1.png"
        [/frame]
    [/draw_weapon_anim]
    [sheath_weapon_anim]
        #landing, only do it when we're not already flying
        terrain_type={DRAKE_UNWALKABLE_TERRAINS}
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-takeoff-1.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-takeoff-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-takeoff-3.png"
        [/frame]
        [frame]
            duration=100
            image="units/drakes/{DRAKE_NAME}-takeoff-4.png"
        [/frame]
    [/sheath_weapon_anim]
#enddef
