#textdomain wesnoth-httt

#define HTTT_COMMANDER AFFIX
    id=Commander
    name= _ "Commander"
    race=human
    image="units/konrad-commander{AFFIX}.png"
    [leading_anim]
        [frame]
            begin=-150
            end=150
            image="units/konrad-commander{AFFIX}-leading.png"
        [/frame]
    [/leading_anim]
    hitpoints=45
    [abilities]
        {ABILITY_LEADERSHIP_LEVEL_2}
    [/abilities]
    movement_type=smallfoot
    movement=6
    experience=60
    level=2
    alignment=lawful
    advances_to=Lord
    usage=mixed fighter
    die_sound={SOUND_LIST:HUMAN_DIE}
    {DEFENSE_ANIM_RANGE "units/konrad-commander{AFFIX}-defend.png" "units/konrad-commander{AFFIX}.png" {SOUND_LIST:HUMAN_HIT} melee}
    [attack]
        name=sword
        description= _"sword"
        icon=attacks/sword-human.png
        type=blade
        range=melee
        damage=8
        number=4
    [/attack]
    [attack]
        name=bow
        description= _"bow"
        type=pierce
        range=ranged
        damage=6
        number=3
    [/attack]
    [attack_anim]
        [filter_attack]
            name=sword
        [/filter_attack]
        [frame]
            begin=-200
            end=-175
            image="units/konrad-commander{AFFIX}.png"
        [/frame]
        [frame]
            begin=-175
            end=-100
            image="units/konrad-commander{AFFIX}-attack-1.png"
        [/frame]
        [if]
            hits=no
            [frame]
                begin=-100
                end=50
                image="units/konrad-commander{AFFIX}-attack-2.png"
                sound={SOUND_LIST:MISS}
            [/frame]
        [/if]
        [else]
            hits=yes
            [frame]
                begin=-100
                end=50
                image="units/konrad-commander{AFFIX}-attack-2.png"
                sound={SOUND_LIST:SWORD_SWISH}
            [/frame]
        [/else]
        [frame]
            begin=50
            end=125
            image="units/konrad-commander{AFFIX}-attack-3.png"
        [/frame]
        [frame]
            begin=125
            end=200
            image="units/konrad-commander{AFFIX}-attack-4.png"
        [/frame]
    [/attack_anim]
    [attack_anim]
        [filter_attack]
            name=bow
        [/filter_attack]
        [missile_frame]
            begin=-150
            end=0
            image="projectiles/missile-n.png"
            image_diagonal="projectiles/missile-ne.png"
        [/missile_frame]
        [frame]
            begin=-475
            end=-400
            image="units/konrad-commander-bow.png"
        [/frame]
        [frame]
            begin=-400
            end=-325
            image="units/konrad-commander-bow-attack1.png"
        [/frame]
        [if]
            hits=yes
            [frame]
                begin=-325
                end=-250
                image="units/konrad-commander-bow-attack2.png"
                sound=bow.ogg
            [/frame]
        [/if]
        [else]
            hits=no
            [frame]
                begin=-325
                end=-250
                image="units/konrad-commander-bow-attack2.png"
                sound=bow-miss.ogg
            [/frame]
        [/else]
        [frame]
            begin=-250
            end=-175
            image="units/konrad-commander-bow-attack3.png"
        [/frame]
        [frame]
            begin=-175
            end=-100
            image="units/konrad-commander-bow-attack4.png"
        [/frame]
        [frame]
            begin=-100
            end=0
            image="units/konrad-commander-bow.png"
        [/frame]
    [/attack_anim]
#enddef

[unit_type]
    {HTTT_COMMANDER ()}
    cost=40
    description= _ "The rank of Commander is held by those who lead battle groups into combat. Possessing leadership skills, they give lower-level units in adjacent hexes improved performance in combat. Commanders are best skilled with the sword, although they also carry a bow to use when necessary. If the Commander is lost, so is the battle."{SPECIAL_NOTES}+{SPECIAL_NOTES_LEADERSHIP}
    {DEFENSE_ANIM_RANGE "units/konrad-commander-bow-defend.png" "units/konrad-commander-bow.png" {SOUND_LIST:HUMAN_HIT} ranged}

    [variation]
        {HTTT_COMMANDER -scepter}
        variation_name=scepter
        cost=60
        description= _ "The rank of Commander is held by those who lead battle groups into combat. Possessing leadership skills, they give lower-level units in adjacent hexes improved performance in combat. Commanders are best skilled with the sword, although they also carry a bow to use when necessary. If the Commander is lost, so is the battle."+{SPECIAL_NOTES}+{SPECIAL_NOTES_LEADERSHIP}+{SPECIAL_NOTES_MAGICAL}
        [attack]
            name=scepter of fire
            #the sceptre of fire always has the 're' writing, this is intentional!
            description= _"sceptre of fire"
            type=fire
            range=ranged
            [specials]
                {WEAPON_SPECIAL_MAGICAL}
            [/specials]
            icon=attacks/fireball.png
            damage=16
            number=4
        [/attack]
        {DEFENSE_ANIM_FILTERED "units/konrad-commander-scepter-defend.png" "units/konrad-commander-scepter.png" {SOUND_LIST:HUMAN_HIT} (
            [filter_second_attack]
                name=scepter of fire
            [/filter_second_attack]
        )}
        {DEFENSE_ANIM_FILTERED "units/konrad-commander-bow-defend.png" "units/konrad-commander-bow.png" {SOUND_LIST:HUMAN_HIT} (
            [filter_second_attack]
                name=bow
            [/filter_second_attack]
        )}
        [attack_anim]
            [filter_attack]
                name=scepter of fire
            [/filter_attack]
            {MISSILE_FRAME_FIREBALL}
            start_time=-550
            [frame]
                sound=fire.wav
                duration=200
                image="units/konrad-commander-scepter-leading.png"
            [/frame]
        [/attack_anim]
    [/variation]
[/unit_type]
#undef HTTT_COMMANDER
