#textdomain wesnoth-trow

#I'm putting TROW's common Macros in here.
#This should make my WML a little more sane
#So Far:
#LOOT
#GUARD_UNIT
#HERO
#UNDEAD_INTEL
#RISE_UP_RISE_UP

#define LOOT AMOUNT SIDE
    [sound]
        name=gold.ogg
    [/sound]

    {VARIABLE amount_gold {AMOUNT}}

    [message]
        speaker=narrator
        message= _ "You retrieve $amount_gold pieces of gold."
        image=wesnoth-icon.png
    [/message]

    {CLEAR_VARIABLE amount_gold}

    [gold]
        side={SIDE}
        amount={AMOUNT}
    [/gold]
#enddef

#define HERO TYPE ID_STRING NAME_STRING SIDE X Y PROFILE
    [unit]
        type={TYPE}
        id={ID_STRING}
        name={NAME_STRING}
        profile={PROFILE}
        side={SIDE}
        x={X}
        y={Y}
        {IS_HERO}
        unrenamable=yes
        random_traits=no
        [modifications]
            {TRAIT_LOYAL}
        [/modifications]
        {IS_LOYAL}
    [/unit]
#enddef

#define GUARD_UNIT TYPE ID_STRING NAME_STRING SIDE X Y
    [unit]
        type={TYPE}
        id={ID_STRING}
        name={NAME_STRING}
        side={SIDE}
        x={X}
        y={Y}

        ai_special=guardian

        [modifications]
            {TRAIT_LOYAL}
        [/modifications]
        {IS_LOYAL}
    [/unit]
#enddef

#define UNDEAD_INTEL TYPE ID_STRING NAME_STRING VALUE SIDE X Y
    [unit]
        type={TYPE}
        id={ID_STRING}
        name={NAME_STRING}
        profile={VALUE}
        side={SIDE}
        x={X}
        y={Y}
        [modifications]
            {TRAIT_UNDEAD}
            {TRAIT_LOYAL}
        [/modifications]
        {IS_LOYAL}
    [/unit]
#enddef

#define LIVING_INTEL TYPE ID_STRING NAME_STRING PROFILE SIDE X Y
    [unit]
        type={TYPE}
        id={ID_STRING}
        name={NAME_STRING}
        profile={PROFILE}
        side={SIDE}
        x={X}
        y={Y}
        random_traits=no
        [modifications]
            {TRAIT_LOYAL}
        [/modifications]
        {IS_LOYAL}
    [/unit]
#enddef

#define RISE_UP_RISE_UP X Y
    [filter]
        side=1
    [/filter]
    [filter_second]
        [not]
            #Basically not any type that has plague
            type=Walking Corpse,Soulless
        [/not]
    [/filter_second]

    [store_unit]
        variable=dead_store
        kill=yes
        [filter]
            x={X}
            y={Y}
        [/filter]
    [/store_unit]

    [unit]
        name= _ "A Former Friend"
#ifdef EASY
        type=Walking Corpse
#endif
#ifdef NORMAL
        type=Soulless
#endif
#ifdef HARD
        type=Ghoul
#endif
        side=2
        x={X}
        y={Y}
        moves=0
        attacks_left=0
        [modifications]
            {TRAIT_UNDEAD}
            {TRAIT_LOYAL}
        [/modifications]
        {IS_LOYAL}
    [/unit]

    {CLEAR_VARIABLE dead_store}
#enddef
