#textdomain wesnoth-utbs
[unit_type]
    id=Pulsing Spire
    name= _ "Pulsing Spire"
    race=monster
    image=units/alien/spire.png
    image_icon="units/alien/spire.png~SCALE(72,72)"
    ellipse="misc/ellipse-nozoc"
    [standing_anim]
        start_time=0
        direction=n,ne,se,s
        [frame]
            duration=100
            image="units/alien/spire.png"
        [/frame]
    [/standing_anim]
    [standing_anim]
        start_time=0
        direction=sw,nw
        [frame]
            duration=100
            image="units/alien/spire.png~FL(horiz)"
        [/frame]
    [/standing_anim]
    hitpoints=35
    movement_type=smallfoot
    [movement_costs]
        cave={UNREACHABLE}
        flat={UNREACHABLE}
    [/movement_costs]
    [defense]
        cave=50
    [/defense]
    movement=1
    experience=150
    {AMLA_DEFAULT}
    level=0
    alignment=chaotic
    advances_to=null
    cost=20
    usage=fighter
    description= _ "This thing is impossible to describe, no one has seen anything like it before."+{SPECIAL_NOTES}+{SPECIAL_NOTES_MAGICAL}
    die_sound=wail.wav
    {DEFENSE_ANIM_FILTERED ("units/alien/spire.png") ("units/alien/spire.png") ("wail-sml.wav") (direction=n,ne,se,s)}
    {DEFENSE_ANIM_FILTERED ("units/alien/spire.png~FL(horiz)") ("units/alien/spire.png~FL(horiz)") ("wail-sml.wav") (direction=nw,sw)}
    [attack]
        name=energy ray
        description= _"energy ray"
        icon=attacks/dark-missile.png
        type=cold
        range=ranged
        [specials]
            {WEAPON_SPECIAL_MAGICAL}
        [/specials]
        damage=6
        number=1
    [/attack]

#define PULSING_SPIRE_ATTACK_ANIMATION AFFIX
    # The affix names an image function.
    start_time=-100
    missile_start_time=-50
    [missile_frame]
        duration=200
        image="projectiles/darkmissile-n.png"
        image_diagonal="projectiles/darkmissile-ne.png"
    [/missile_frame]
    [if]
        hits=no
        [frame]
            duration=200
            image="units/alien/spire.png~{AFFIX}"
            sound=magic-dark-miss.ogg
        [/frame]
    [/if]
    [else]
        hits=yes
        [frame]
            duration=200
            image="units/alien/spire.png~{AFFIX}"
            sound=magic-dark.ogg
        [/frame]
    [/else]
#enddef

    # NOTE: The following attack filters deliberately match both ranged and melee.
    [attack_anim]
        [filter_attack]
            name=energy ray
        [/filter_attack]
        direction=n,ne,se,s
        {PULSING_SPIRE_ATTACK_ANIMATION "NOP()"}
    [/attack_anim]
    [attack_anim]
        [filter_attack]
            name=energy ray
        [/filter_attack]
        direction=nw,sw
        {PULSING_SPIRE_ATTACK_ANIMATION "FL(horiz)"}
    [/attack_anim]

#undef PULSING_SPIRE_ATTACK_ANIMATION
[/unit_type]
