public override void Execute()
    {
        parentMenu.gameObject.SetActive(false);
        Debug.Log("attack! - " + combatant);

        BattleOrder order = new BattleOrder();

        order.Action          = "attack";
        order.SourceCombatant = combatant;

        MapManager map = GameObject.FindGameObjectWithTag("Map").GetComponent <MapManager>();
        //List<Tile> tiles = map.GetTilesInRange(combatant.Tile, 1, true);
        List <Tile> tiles = map.GetTilesInRangeThreadsafe(combatant.Tile.TileData, 1, TeamId.MOVE_THROUGH_ALL)
                            .ConvertAll(t => t.Tile);

        tiles.Remove(combatant.Tile);

        GameObject objToSpawn = new GameObject("Tile Picker - Attack");

        objToSpawn.AddComponent <TilePicker>();
        TilePicker tilePicker = objToSpawn.GetComponent <TilePicker>();

        tilePicker.SetTiles(tiles);
        tilePicker.battleStateTracker.previous = this.parentMenu.battleStateTracker;
        tilePicker.SetBattleOrder(order);

        parentMenu.CleanUp();
    }
Example #2
0
    public void SetCombatant(Combatant combatant)
    {
        this.combatant = combatant;
        sourceTile = combatant.Tile;
        MapManager map = GameObject.FindGameObjectWithTag("Map").GetComponent<MapManager>();
        List<Tile> tiles = map.GetTilesInRange(combatant.Tile, 3, false);
        tiles = TileUtility.FilterOutOccupiedTiles(tiles);

        GameObject objToSpawn;
        objToSpawn = new GameObject("Tile Picker");
        objToSpawn.AddComponent<TilePicker>();
        tilePicker = objToSpawn.GetComponent<TilePicker>();
        tilePicker.SetTiles(tiles);
    }
    public void SetCombatant(Combatant combatant)
    {
        this.combatant = combatant;
        order.SourceCombatant = combatant;
        order.Action = "attack";
        MapManager map = GameObject.FindGameObjectWithTag("Map").GetComponent<MapManager>();
        List<Tile> tiles = map.GetTilesInRange(combatant.Tile, 1, true);
        tiles.Remove(combatant.Tile);

        GameObject objToSpawn;
        objToSpawn = new GameObject("Tile Picker");
        objToSpawn.AddComponent<TilePicker>();
        tilePicker = objToSpawn.GetComponent<TilePicker>();
        tilePicker.SetTiles(tiles);
    }
Example #4
0
    public void SetCombatant(Combatant combatant)
    {
        this.combatant = combatant;
        sourceTile     = combatant.Tile;
        MapManager  map   = GameObject.FindGameObjectWithTag("Map").GetComponent <MapManager>();
        List <Tile> tiles = map.GetTilesInRange(combatant.Tile, 3, false);

        tiles = TileUtility.FilterOutOccupiedTiles(tiles);


        GameObject objToSpawn;

        objToSpawn = new GameObject("Tile Picker");
        objToSpawn.AddComponent <TilePicker>();
        tilePicker = objToSpawn.GetComponent <TilePicker>();
        tilePicker.SetTiles(tiles);
    }
Example #5
0
    public void SetCombatant(Combatant combatant)
    {
        this.combatant        = combatant;
        order.SourceCombatant = combatant;
        order.Action          = "attack";
        MapManager  map   = GameObject.FindGameObjectWithTag("Map").GetComponent <MapManager>();
        List <Tile> tiles = map.GetTilesInRange(combatant.Tile, 1, true);

        tiles.Remove(combatant.Tile);

        GameObject objToSpawn;

        objToSpawn = new GameObject("Tile Picker");
        objToSpawn.AddComponent <TilePicker>();
        tilePicker = objToSpawn.GetComponent <TilePicker>();
        tilePicker.SetTiles(tiles);
    }