#textdomain wesnoth-units

# Common statistics plus variations of some values
#define UNIT_BODY_WALKING_CORPSE_STATS MOVTYPE_NAME MOVES_NUMBER HP_AMOUNT COST ATTACK_NAME ATTACK_ICON ATTACK_TYPE
    race=undead
    {TRAIT_FEARLESS_MUSTHAVE}
    level=0
    experience=24
    alignment=chaotic
    usage=fighter
    description= _ "Walking Corpses are the bodies of the dead, re-animated by dark magic. Though not especially dangerous to a trained soldier, the sight of one’s former comrades amongst their number is frightening to say the least."
    die_sound={SOUND_LIST:ZOMBIE_WEAK_HIT}
    [resistance]
        arcane=140
    [/resistance]

    movement_type={MOVTYPE_NAME}
    movement={MOVES_NUMBER}
    hitpoints={HP_AMOUNT}
    cost={COST}

    # The human-looking hand in the attack icon doesn't work well for some races, so it's
    # changeable here. The animals have no hands at all, so they get fangs. The internal
    # name can't change from touch though.
    [attack]
        name=touch
        description={ATTACK_NAME}
        icon={ATTACK_ICON}
        range=melee
        type={ATTACK_TYPE}
        damage=6
        number=2
        [specials]
            {WEAPON_SPECIAL_SOTA_PLAGUE}
        [/specials]
    [/attack]
#enddef

# Variant animations for the Walking Corpse
#define UNIT_BODY_WALKING_CORPSE_GRAPHICS BASE_NAME
    image="units/undead/{BASE_NAME}.png"
    {DEFENSE_ANIM "units/undead/{BASE_NAME}-defend.png" "units/undead/{BASE_NAME}.png" {SOUND_LIST:ZOMBIE_WEAK_HIT} }
    [death]
        start_time=0
        [frame]
            image="units/undead/{BASE_NAME}-die-[1~4].png:150,units/undead/soulless-die-[5~10].png:150"
        [/frame]
    [/death]
    [attack_anim]
        [filter_attack]
            name=touch
        [/filter_attack]
        direction=s
        start_time=-200
        [frame]
            image="units/undead/{BASE_NAME}-attack-s.png:400"
            sound=zombie-attack.wav
        [/frame]
    [/attack_anim]
    [attack_anim]
        [filter_attack]
            name=touch
        [/filter_attack]
        direction=n
        start_time=-200
        [frame]
            image="units/undead/{BASE_NAME}-attack-n.png:400"
            sound=zombie-attack.wav
        [/frame]
    [/attack_anim]
    [attack_anim]
        [filter_attack]
            name=touch
        [/filter_attack]
        direction=se,sw,ne,nw
        start_time=-200
        [frame]
            image="units/undead/{BASE_NAME}-attack.png:400"
            sound=zombie-attack.wav
        [/frame]
    [/attack_anim]
#enddef

#textdomain wesnoth-sota
[unit_type]
    id=SotA Walking Corpse_Dummy
    # po: A fake unit type that appears in the recruit list as soon as the
    # po: player has access to more than one type of walking corpse. Trying to
    # po: recruit it launches the zombie recruit dialog as a child of the normal
    # po: recruitment dialog. "Walking Corpse" is not used here because some swim,
    # po: and some fly.
    name= _ "All Corpses"
    hide_help=yes
    image="units/undead/corpses-unit.png"
    experience=1
    cost=1
    movement=1
    hitpoints=1
    race=undead
    level=0
    alignment=chaotic
    # Setting hide_help doesn't prevent the player from getting a profile in the recruit
    # dialog, so we need to deal with that.
    description= _ "Choose this “unit” to get a list of available corpses."
[/unit_type]
#textdomain wesnoth-units

[unit_type]
    id=SotA Walking Corpse_Human
    name= _ "Walking Corpse"
    advances_to=SotA Soulless_Human
    profile=portraits/undead/walking-corpse.webp
    {UNIT_BODY_WALKING_CORPSE_STATS    smallfoot 4 18 8 ( _ "touch") "attacks/touch-zombie.png" impact}
    {UNIT_BODY_WALKING_CORPSE_GRAPHICS zombie}
    [movement_costs]
        deep_water=4
    [/movement_costs]
    [defense]
        deep_water=90
    [/defense]
[/unit_type]

[unit_type]
    id=SotA Walking Corpse_Dwarf
    name= _ "Walking Corpse"
    advances_to=SotA Soulless_Dwarf
    profile=portraits/undead/zombie-dwarf.webp
    {UNIT_BODY_WALKING_CORPSE_STATS    dwarvishfoot 3 21 7 ( _ "touch") "attacks/touch-zombie.png" impact}
    {UNIT_BODY_WALKING_CORPSE_GRAPHICS zombie-dwarf}
    [movement_costs]
        deep_water=3
    [/movement_costs]
    [defense]
        deep_water=90
    [/defense]
[/unit_type]

[unit_type]
    id=SotA Walking Corpse_Goblin
    name= _ "Walking Corpse"
    advances_to=SotA Soulless_Goblin
    profile=portraits/undead/zombie-goblin.webp
    {UNIT_BODY_WALKING_CORPSE_STATS    smallfoot 4 13 6 ( _ "touch") "attacks/touch-zombie.png" impact}
    {UNIT_BODY_WALKING_CORPSE_GRAPHICS zombie-goblin}
    [movement_costs]
        deep_water=4
    [/movement_costs]
    [defense]
        deep_water=90
    [/defense]
[/unit_type]

[unit_type]
    id=SotA Flying Corpse_Gryphon
    #textdomain wesnoth-sota
    name= _ "Flying Corpse"
    #textdomain wesnoth-units
    advances_to=SotA Soulless_Gryphon
    profile=portraits/undead/zombie-gryphon.webp
    {UNIT_BODY_WALKING_CORPSE_STATS    fly 5 21 9 ( _ "claws") "attacks/claws-animal.png" blade}
    {UNIT_BODY_WALKING_CORPSE_GRAPHICS zombie-gryphon}
    [movement_costs]
        deep_water=1
    [/movement_costs]
    [defense]
        mountains=40
        deep_water=50
    [/defense]
[/unit_type]

[unit_type]
    id=SotA Walking Corpse_Mounted
    name= _ "Walking Corpse"
    advances_to=SotA Soulless_Mounted
    profile=portraits/undead/walking-corpse.webp
    {UNIT_BODY_WALKING_CORPSE_STATS    mounted 5 21 9 ( _ "touch") "attacks/touch-zombie.png" impact}
    {UNIT_BODY_WALKING_CORPSE_GRAPHICS zombie-mounted}
    [movement_costs]
        deep_water=4
    [/movement_costs]
    [defense]
        deep_water=90
    [/defense]
[/unit_type]

[unit_type]
    id=SotA Walking Corpse_Saurian
    name= _ "Walking Corpse"
    advances_to=SotA Soulless_Saurian
    profile=portraits/undead/zombie-saurian.webp
    {UNIT_BODY_WALKING_CORPSE_STATS    lizard 4 16 7 ( _ "touch") "attacks/touch-zombie.png" impact}
    {UNIT_BODY_WALKING_CORPSE_GRAPHICS zombie-saurian}
    [movement_costs]
        deep_water=4
    [/movement_costs]
    [defense]
        deep_water=90
    [/defense]
[/unit_type]

[unit_type]
    id=SotA Swimming Corpse
    #textdomain wesnoth-sota
    name= _ "Swimming Corpse"
    #textdomain wesnoth-units
    advances_to=SotA Soulless_Swimmer
    profile=portraits/undead/zombie-swimmer.webp
    {UNIT_BODY_WALKING_CORPSE_STATS    swimmer 4 18 8 ( _ "touch") "attacks/touch-zombie.png" impact}
    {UNIT_BODY_WALKING_CORPSE_GRAPHICS zombie-swimmer}
    [movement_costs]
        forest=4
        hills=4
    [/movement_costs]
    [defense]
        deep_water=50
    [/defense]
[/unit_type]

[unit_type]
    id=SotA Walking Corpse_Troll
    name= _ "Walking Corpse"
    advances_to=SotA Soulless_Troll
    profile=portraits/undead/zombie-troll.webp
    {UNIT_BODY_WALKING_CORPSE_STATS    largefoot 4 21 8 ( _ "touch") "attacks/touch-zombie.png" impact}
    {UNIT_BODY_WALKING_CORPSE_GRAPHICS zombie-troll}
    [movement_costs]
        deep_water=4
    [/movement_costs]
    [defense]
        deep_water=90
    [/defense]
[/unit_type]

[unit_type]
    id=SotA Walking Corpse_Wose
    name= _ "Walking Corpse"
    advances_to=SotA Soulless_Wose
    profile=portraits/undead/zombie-wose.webp
    {UNIT_BODY_WALKING_CORPSE_STATS    treefolk 3 26 8 ( _ "touch") "attacks/crush-wose.png" impact}
    {UNIT_BODY_WALKING_CORPSE_GRAPHICS zombie-wose}
    [movement_costs]
        deep_water=3
    [/movement_costs]
    [defense]
        deep_water=90
    [/defense]
[/unit_type]

[unit_type]
    id=SotA Walking Corpse_Wolf
    name= _ "Walking Corpse"
    advances_to=SotA Soulless_Wolf
    profile=portraits/undead/zombie-wolf.webp
    {UNIT_BODY_WALKING_CORPSE_STATS orcishfoot 5 19 9 ( _ "fangs") "attacks/fangs-animal.png" blade}
    {UNIT_BODY_WALKING_CORPSE_GRAPHICS zombie-wolf}
    [movement_costs]
        deep_water=4
    [/movement_costs]
    [defense]
        deep_water=90
        village=50
    [/defense]
[/unit_type]

[unit_type]
    id=SotA Walking Corpse_Wolf Rider
    name= _ "Walking Corpse"
    advances_to=SotA Soulless_Wolf Rider
    profile=portraits/undead/zombie-goblin.webp
    {UNIT_BODY_WALKING_CORPSE_STATS orcishfoot 5 20 9 ( _ "touch") "attacks/touch-zombie.png" impact}
    {UNIT_BODY_WALKING_CORPSE_GRAPHICS zombie-wolf-rider}
    [movement_costs]
        deep_water=4
    [/movement_costs]
    [defense]
        deep_water=90
    [/defense]
[/unit_type]

[unit_type]
    id=SotA Walking Corpse_Spider
    name= _ "Walking Corpse"
    advances_to=SotA Soulless_Spider
    profile=portraits/undead/zombie-spider.webp
    {UNIT_BODY_WALKING_CORPSE_STATS dwarvishfoot 4 25 9 ( _ "fangs") "attacks/fangs-spider.png" blade}
    {UNIT_BODY_WALKING_CORPSE_GRAPHICS zombie-spider}
    [movement_costs]
        deep_water=4
    [/movement_costs]
    [defense]
        deep_water=90
        village=50
    [/defense]
[/unit_type]

[unit_type]
    id=SotA Walking Corpse_Rat
    name= _ "Walking Corpse"
    advances_to=SotA Soulless_Rat
    profile=portraits/undead/zombie-rat.webp
    {UNIT_BODY_WALKING_CORPSE_STATS rodentfoot 3 12 5 ( _ "bite") "attacks/fangs-rodent.png" blade}
    {UNIT_BODY_WALKING_CORPSE_GRAPHICS zombie-rat}
    [movement_costs]
        deep_water=3
    [/movement_costs]
    [defense]
        deep_water=90
    [/defense]
[/unit_type]

[unit_type]
    id=SotA Flying Corpse_Bat
    #textdomain wesnoth-sota
    name= _ "Flying Corpse"
    #textdomain wesnoth-units
    advances_to=SotA Soulless_Bat
    profile=portraits/undead/zombie-bat.webp
    {UNIT_BODY_WALKING_CORPSE_STATS fly 5 15 8 ( _ "fangs") "attacks/fangs-animal.png" blade}
    image="units/undead/zombie-bat-se-3.png"
    die_sound="bat-flapping.wav"
    [movement_costs]
        cave=1
        fungus=1
        deep_water=1
    [/movement_costs]
    [defense]
        cave=50
        fungus=50
        deep_water=50
    [/defense]
    [resistance]
        cold=70
    [/resistance]

    [death]
        start_time=0
        [frame]
            image="units/undead/zombie-bat-die-[1~4].png:150,units/undead/soulless-die-[5~10].png:150"
        [/frame]
    [/death]
    [defend]
        start_time=-126
        [if]
            hits=miss
            offset=0.0~-0.15,-0.15~0.0
        [/if]
        [else]
            hits=hit
            hit_sound_start_time=-25
            [hit_sound_frame]
                sound={SOUND_LIST:ZOMBIE_WEAK_HIT}
            [/hit_sound_frame]
        [/else]
        [if]
            direction=s,sw,se
            [frame]
                image="units/undead/zombie-bat-se-[3,4,3].png:[1,250,1]"
            [/frame]
        [/if]
        [else]
            direction=n,nw,ne
            [frame]
                image="units/undead/zombie-bat-ne-[3,4,3].png:[1,250,1]"
            [/frame]
        [/else]
    [/defend]
    [standing_anim]
        direction=s,se,sw
        start_time=0
        [frame]
            image="units/undead/zombie-bat-se-[3~1,2~5,4].png:[50,60,80,60,50,60,80,60]"
        [/frame]
    [/standing_anim]
    [standing_anim]
        direction=n,ne,nw
        start_time=0
        [frame]
            image="units/undead/zombie-bat-ne-[3~1,2~5,4].png:[50,60,80,60,50,60,80,60]"
        [/frame]
    [/standing_anim]

    [attack_anim]
        [filter_attack]
            name=touch
        [/filter_attack]
        direction=s,se,sw
        offset=0.0~0.9:200,0.9~0.0:160
        start_time=-200
        [frame]
            image="units/undead/zombie-bat-se-[3,2].png:30"
        [/frame]
        [frame]
            image="units/undead/zombie-bat-se-1.png:30"
            sound=bat-flapping.wav
        [/frame]
        [frame]
            image="units/undead/zombie-bat-se-[2,3].png:30"
        [/frame]
        [frame]
            image="units/undead/zombie-bat-se-4.png:70"
            sound=zombie-attack.wav
        [/frame]
        [frame]
            image="units/undead/zombie-bat-se-[3,2,3].png:[50*2,40]"
        [/frame]
    [/attack_anim]

    [attack_anim]
        [filter_attack]
            name=touch
        [/filter_attack]
        direction=n,ne,nw
        offset=0.0~0.9:200,0.9~0.0:160
        start_time=-200
        [frame]
            image="units/undead/zombie-bat-ne-[3,2].png:30"
        [/frame]
        [frame]
            image="units/undead/zombie-bat-ne-1.png:30"
            sound=bat-flapping.wav
        [/frame]
        [frame]
            image="units/undead/zombie-bat-ne-[2,3].png:30"
        [/frame]
        [frame]
            image="units/undead/zombie-bat-ne-4.png:70"
            sound=zombie-attack.wav
        [/frame]
        [frame]
            image="units/undead/zombie-bat-ne-[3,2,3].png:[50*2,40]"
        [/frame]
    [/attack_anim]
[/unit_type]

[hide_help]
    type=Walking Corpse
[/hide_help]

#undef UNIT_BODY_WALKING_CORPSE_STATS
#undef UNIT_BODY_WALKING_CORPSE_GRAPHICS
