#textdomain wesnoth-ai
[event]
    name=preload
    first_time_only=no
    [lua]
        code = << register_test('0004-filtered_combat','Filtered combat test'); >>
    [/lua]
[/event]

[event]
    name=0004-filtered_combat
    first_time_only=no

    [message]
        speaker=narrator
        image=wesnoth-icon.png
        message= _ "This situation should test the ability of AI to obey own unit and enemy unit filters while making attacks. Only dwarves should attack. Dark Adepts are not to be attacked."
    [/message]
    [unit]
        side=2
        x,y=20,7
        type="Dwarvish Berserker"
    [/unit]
    [unit]
        side=3
        x,y=20,5
        type="Dark Adept"
        random_traits="no"
        [modifications]
            {TRAIT_RESILIENT}
        [/modifications]
    [/unit]
    [unit]
        side=2
        x,y=13,21
        type="Elvish Sharpshooter"
    [/unit]
    [unit]
        side=3
        x,y=15,22
        type="Peasant"
    [/unit]
    [unit]
        side=2
        x,y=23,14
        type="Orcish Warlord"
    [/unit]
    [unit]
        side=3
        x,y=25,15
        type="Dark Adept"
    [/unit]
    [unit]
        side=2
        x,y=4,11
        type="Dwarvish Lord"
    [/unit]
    [unit]
        side=3
        x,y=5,13
        type="Dark Sorcerer"
    [/unit]
    [modify_side]
        side=3
        switch_ai=$test_path_to_idle_ai
    [/modify_side]
    {MODIFY_AI_ADD_ASPECT 2 attacks (
        [facet]
            name=ai_default_rca::aspect_attacks
            invalidate_on_gamestate_change=yes
            [filter_own]
                race=dwarf
            [/filter_own]
            [filter_enemy]
                [not]
                    type="Dark Adept"
                [/not]
            [/filter_enemy]
        [/facet]
    )}
[/event]
