GameConfig:
    Type: TBS
    ActionTimer: 10s
    RoundLimit: 100
    FogOfWar: false

Agents:
    - HumanAgent
    - MCTSAgent

GameRenderer:
    Resolution:
        Width: 800
        Height: 600
    Default Assets:
        Selected: ../../assets/Tiles/selected.png
        FogOfWar: ../../assets/Tiles/notVisible.png
    #Optional:
    #Font: ../../assets/arial.ttf
    #OutlineShader: ../../assets/OutLine.frag

Player:
    Parameters:
        SpawnPoints: [0,100,1000]
        Score: [0,0,1000]

Tiles:
    Plain:
        Sprite: ../../assets/Tiles/plain.png
        Symbol: .
        IsWalkable: true
        DefaultTile: true

Entities:
    Portal:
        Sprite: ../../assets/Entities/treeHouse.png
        Symbol: c
        LineOfSightRange: 5
        CanSpawn: Units
        Actions: [Spawn]
        Parameters:
            Health: 100

    Fighter:
        Sprite: ../../assets/Entities/unit_9.png
        Symbol: f
        LineOfSightRange: 6
        Actions: [Move, Attack, Capture]
        Parameters:
            Health: 100
            AttackDamage: 15
            MovementPoints: 2
            AttackRange: 1
        Cost:
            SpawnPoints: 20
            
    Archer:
        Sprite: ../../assets/Entities/unit_3.png
        Symbol: f
        LineOfSightRange: 6
        Actions: [Move, Attack, Capture]
        Parameters:
            Health: 100
            AttackDamage: 10
            AttackRange: 3
            MovementPoints: 2
            ReloadTime: 1
        Cost:
            SpawnPoints: 10
            
    Wizard:
        Sprite: ../../assets/Entities/unit_10.png
        Symbol: f
        LineOfSightRange: 6
        Actions: [Move, Attack, Capture]
        Parameters:
            Health: 100
            AttackDamage: 50
            AttackRange: 5
            MovementPoints: 3
            ReloadTime: 2
        Cost:
            SpawnPoints: 30

    Book:
        Sprite: ../../assets/Entities/wonder.png
        Symbol: b

    Canister:
        Sprite: ../../assets/Entities/floorRockTall.png 
        Symbol: M
        


Actions:

    Spawn:
        Type: EntityAction
        Cooldown: 1
        Targets:
            EntityTypeTarget:
                Type: EntityType
                ValidTargets: Units
                Conditions:
                    - "CanSpawn(Source, EntityTypeTarget)"
                    - "CanAfford(Source.Player, EntityTypeTarget)"
            TargetPosition:
                Type: Position
                SamplingMethod: 
                    Type: Neighbours
                    Options:
                        Shape: Square
                        Size: 1
                Conditions:
                    - "IsWalkable(TargetPosition)"

        Effects:
            - "SpawnEntity(Source, EntityTypeTarget, TargetPosition)"
            - "PayCost(Source.Player, EntityTypeTarget)"
            - "ModifyResource(Source.Player.Score, 2)"

    # Attack Actions
    Attack:
        Type: EntityAction
        Cooldown: 1
        Targets:
            Target:
                Type: Entity
                ValidTargets: Units
                SamplingMethod:
                    Type: Neighbours
                    Options:
                        Shape: AllPositions
                        AllowDiagonals: true
                        Size: 1
                Conditions:
                    - "DifferentPlayer(Source, Target)"
                    - "InRange(Source, Target, Source.AttackRange)"
        Effects:
            - "Attack(Target.Health, Source.AttackDamage)"


    # Move Actions
    Move:
        Type: EntityAction
        Cooldown: 1
        Targets:
            Target:
                Type: Position
                SamplingMethod: 
                    Type: Dijkstra
                    Options:
                        SearchSize: 3
                        AllowDiagonals: false
                Conditions:
                    - "IsWalkable(Target)"
        Effects:
            - "Move(Source, Target)"

            
    Capture:
        Type: EntityAction
        Targets:
            Target:
                Type: Entity
                ValidTargets: Book
                SamplingMethod: 
                    Type: Dijkstra
                    Options:
                        SearchSize: 1
                        AllowDiagonals: true
                Conditions:
                    - "DifferentPlayer(Target)"
        Effects:
            - "Remove(Target)"


Board:
    GenerationType: Manual
    Layout: |-
        .  .  .  .  .  b1 .  .  .  .  .
        .  .  .  .  .  .  .  .  .  .  .
        .  .  c1 .  .  c1 .  .  c1 .  .
        .  .  .  .  .  .  .  .  .  .  .
        .  .  .  M  .  .  M  M  .  .  .
        .  .  .  .  .  .  .  .  .  M  .
        .  M  M  .  .  .  .  .  M  M  .
        .  M  .  .  .  .  .  .  .  .  .
        .  .  .  M  M  .  .  M  .  .  .
        .  .  .  .  .  .  .  .  .  .  .
        .  .  c0 .  .  c0 .  .  c0 .  .
        .  .  .  .  .  .  .  .  .  .  .
        .  .  .  .  .  b0 .  .  .  .  .
                   
ForwardModel:
    LoseConditions: #If true: Player -> cant play
        HasNoPortal:
        - "HasNoEntity(Source, Book)"

EntityGroups:
    Units: [Fighter, Archer, Wizard]

#Action categories
GameDescription:
    Type: CombatGame
    Actions:
        Move: [Move]
        Spawn: [Spawn]
        Attack: [Attack]
    Entities:
        Base: [Book]
        Building: [Book]
        Spawner: [Portal]
        Unit: [Fighter, Archer, Wizard]
        Fighter: [Fighter, Archer, Wizard]

        
GameRunner:
    AgentInitializationTime:
        Enabled: true
        BudgetTimeMs: 1000
        DisqualificationTimeMs: 2000
    AgentComputationTime:
        Enabled: true
        BudgetTimeMs: 500
        DisqualificationTimeMs: 1000
        MaxNumberWarnings: 5