#textdomain wesnoth-utbs
# This is the Alien Central Body with his immune to attacks
[unit_type]
    id=Central Body
    name= _ "Central Body"
    race=monster
    image=units/alien/core-compact.png
    [standing_anim]
        start_time=0
        direction=n,ne,se,s
        [frame]
            duration=100
            image="units/alien/core-compact.png"
        [/frame]
    [/standing_anim]
    [standing_anim]
        start_time=0
        direction=sw,nw
        [frame]
            duration=100
            image="units/alien/core-compact.png~FL(horiz)"
        [/frame]
    [/standing_anim]
    hitpoints=100
    movement_type=smallfoot
    [movement_costs]
        cave={UNREACHABLE}
        flat={UNREACHABLE}
    [/movement_costs]
    [resistance]
        blade=0
        pierce=0
        impact=0
        fire=0
        cold=0
        arcane=0
    [/resistance]
    movement=7
    experience=150
    {AMLA_DEFAULT}
    level=3
    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}
    {DEFENSE_ANIM_FILTERED ("units/alien/core-compact.png") ("units/alien/core-compact.png") ("wail.wav") (direction=n,ne,se,s)}
    {DEFENSE_ANIM_FILTERED ("units/alien/core-compact.png~FL(horiz)") ("units/alien/core-compact.png~FL(horiz)") ("wail.wav") (direction=nw,sw)}

    [attack]
        name=energy ray
        description= _"energy ray"
        icon=attacks/dark-missile.png
        type=cold
        range=melee
        [specials]
            {WEAPON_SPECIAL_MAGICAL}
        [/specials]
        damage=7
        number=3
    [/attack]
    [attack]
        name=energy ray
        description= _"energy ray"
        icon=attacks/dark-missile.png
        type=cold
        range=ranged
        [specials]
            {WEAPON_SPECIAL_MAGICAL}
        [/specials]
        damage=7
        number=3
    [/attack]

#define CENTRAL_BODY_ATTACK_ANIMATION AFFIX
    # The affix should name 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/core-compact.png~{AFFIX}"
            sound=magic-dark-miss.ogg
        [/frame]
    [/if]
    [else]
        hits=yes
        [frame]
            duration=200
            image="units/alien/core-compact.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
        {CENTRAL_BODY_ATTACK_ANIMATION "NOP"}
    [/attack_anim]
    [attack_anim]
        [filter_attack]
            name=energy ray
        [/filter_attack]
        direction=nw,sw
        {CENTRAL_BODY_ATTACK_ANIMATION "FL(horiz)"}
    [/attack_anim]

#undef CENTRAL_BODY_ATTACK_ANIMATION
[/unit_type]
