Beispiel #1
0
    /// <summary>
    /// Permet de d閠erminer si autour des cases adjacentes il y a des effets de terrain qui pourraient g阯er le d閜loiement de troupes.
    /// </summary>
    /// <param name="tileCheck"></param>
    /// <returns></returns>
    bool CheckConditions(GameObject tileCheck, int origin)
    {
        //Y a une unit�
        if (tileCheck.GetComponent <TileScript>().Unit != null)
        {
            return(true);
        }

        //Y a de l'eau ou un ravin?
        if (tileCheck.GetComponent <TileScript>().TerrainEffectList.Contains(MYthsAndSteel_Enum.TerrainType.Ravin) ||
            tileCheck.GetComponent <TileScript>().TerrainEffectList.Contains(MYthsAndSteel_Enum.TerrainType.Eau))
        {
            return(true);
        }

        //RIVIERE?
        if (tileCheck.GetComponent <TileScript>().TerrainEffectList.Contains(MYthsAndSteel_Enum.TerrainType.Rivi鑢e_Nord) &&
            PlayerStatic.CheckDirection(origin, tileCheck.GetComponent <TileScript>().TileId) == MYthsAndSteel_Enum.Direction.Sud)
        {
            if (!tileCheck.GetComponent <TileScript>().TerrainEffectList.Contains(MYthsAndSteel_Enum.TerrainType.Pont_Nord))
            {
                return(true);
            }
        }

        if (tileCheck.GetComponent <TileScript>().TerrainEffectList.Contains(MYthsAndSteel_Enum.TerrainType.Rivi鑢e_Sud) &&
            PlayerStatic.CheckDirection(origin, tileCheck.GetComponent <TileScript>().TileId) == MYthsAndSteel_Enum.Direction.Nord)
        {
            if (!tileCheck.GetComponent <TileScript>().TerrainEffectList.Contains(MYthsAndSteel_Enum.TerrainType.Pont_Sud))
            {
                return(true);
            }
        }

        if (tileCheck.GetComponent <TileScript>().TerrainEffectList.Contains(MYthsAndSteel_Enum.TerrainType.Rivi鑢e_Ouest) &&
            PlayerStatic.CheckDirection(origin, tileCheck.GetComponent <TileScript>().TileId) == MYthsAndSteel_Enum.Direction.Est)
        {
            if (!tileCheck.GetComponent <TileScript>().TerrainEffectList.Contains(MYthsAndSteel_Enum.TerrainType.Rivi鑢e_Ouest))
            {
                return(true);
            }
        }

        if (tileCheck.GetComponent <TileScript>().TerrainEffectList.Contains(MYthsAndSteel_Enum.TerrainType.Rivi鑢e_Est) &&
            PlayerStatic.CheckDirection(origin, tileCheck.GetComponent <TileScript>().TileId) == MYthsAndSteel_Enum.Direction.Ouest)
        {
            if (!tileCheck.GetComponent <TileScript>().TerrainEffectList.Contains(MYthsAndSteel_Enum.TerrainType.Rivi鑢e_Est))
            {
                return(true);
            }
        }

        return(false);

        //Ajouter les barbelets.
    }
Beispiel #2
0
    /// <summary>
    /// Ajoute la tile à TileSelected. Pour le mvmt du joueur => Check egalement toutes les conditions de déplacement.
    /// </summary>
    /// <param name="tileId">Tile</param>
    public void AddMouvement(int tileId)
    {
        check = false;
        if (_isInMouvement)
        {
            if (newNeighbourId.Contains(tileId)) // Si cette case est dans la range de l'unité.
            {
                if (selectedTileId.Contains(tileId))
                {
                    // Supprime toutes les cases sélectionnées à partir de l'ID tileId.
                    for (int i = selectedTileId.IndexOf(tileId); i < selectedTileId.Count; i++)
                    {
                        if (PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Forêt, selectedTileId[i]) || PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Mont, selectedTileId[i]))
                        {
                            // Redistribution du Range à chaque suppression de case.
                            if (RouteBonus)
                            {
                                RouteBonus = false;
                                if (mUnit.GetComponent <UnitScript>().MoveLeft + 1 > mUnit.GetComponent <UnitScript>().UnitSO.MoveSpeed)
                                {
                                    mUnit.GetComponent <UnitScript>().MoveSpeedBonus += 1;
                                }
                                else
                                {
                                    mUnit.GetComponent <UnitScript>().MoveLeft += 1;
                                }
                            }
                            else
                            {
                                if (mUnit.GetComponent <UnitScript>().MoveLeft + 2 > mUnit.GetComponent <UnitScript>().UnitSO.MoveSpeed)
                                {
                                    int moveToAdd = 2 - (mUnit.GetComponent <UnitScript>().UnitSO.MoveSpeed - mUnit.GetComponent <UnitScript>().MoveLeft);
                                    mUnit.GetComponent <UnitScript>().MoveLeft        = mUnit.GetComponent <UnitScript>().UnitSO.MoveSpeed;
                                    mUnit.GetComponent <UnitScript>().MoveSpeedBonus += moveToAdd;
                                }
                                else
                                {
                                    mUnit.GetComponent <UnitScript>().MoveLeft += 2;
                                }
                            }

                            temp.Add(selectedTileId[i]);
                            TilesManager.Instance.TileList[selectedTileId[i]].GetComponent <TileScript>().ActiveChildObj(MYthsAndSteel_Enum.ChildTileType.MoveSelect, _selectedSprite); // Repasse les sprites en apparence "séléctionnable".
                            // Déselectionne les cases. hxh

                            TilesManager.Instance.TileList[selectedTileId[i]].GetComponent <TileScript>().DesActiveChildObj(MYthsAndSteel_Enum.ChildTileType.MoveArrow);
                        }
                        else
                        {
                            // Redistribution du Range à chaque suppression de case.
                            if (mUnit.GetComponent <UnitScript>().MoveLeft + 1 > mUnit.GetComponent <UnitScript>().UnitSO.MoveSpeed)
                            {
                                int moveToAdd = 1 - (mUnit.GetComponent <UnitScript>().UnitSO.MoveSpeed - mUnit.GetComponent <UnitScript>().MoveLeft);
                                mUnit.GetComponent <UnitScript>().MoveLeft        = mUnit.GetComponent <UnitScript>().UnitSO.MoveSpeed;
                                mUnit.GetComponent <UnitScript>().MoveSpeedBonus += moveToAdd;
                            }
                            else
                            {
                                if (RouteBonus)
                                {
                                    RouteBonus = false;
                                }
                                else
                                {
                                    mUnit.GetComponent <UnitScript>().MoveLeft += 1;
                                }
                            }

                            temp.Add(selectedTileId[i]);
                            TilesManager.Instance.TileList[selectedTileId[i]].GetComponent <TileScript>().ActiveChildObj(MYthsAndSteel_Enum.ChildTileType.MoveSelect, _selectedSprite); // Repasse les sprites en apparence "séléctionnable".
                        }
                    }
                    foreach (int i in temp)
                    {
                        selectedTileId.Remove(i);
                    }
                    temp.Clear();

                    Attaque.Instance.RemoveTileSprite();
                    Attaque.Instance.StartAttackSelectionUnit(selectedTileId[selectedTileId.Count - 1]);
                }  // Si cette case est déjà selectionnée.
                else if (PlayerStatic.IsNeighbour(tileId, selectedTileId[selectedTileId.Count - 1], TilesManager.Instance.TileList[tileId].GetComponent <TileScript>().Line, false))
                {
                    // et qu'il reste du mvmt, on assigne la nouvelle case selectionnée à la liste SelectedTile.
                    if (PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Rivière_Est, tileId) && PlayerStatic.CheckDirection(tileId, selectedTileId[selectedTileId.Count - 1]) == MYthsAndSteel_Enum.Direction.Est && !PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Pont_Est, tileId))
                    {
                        check = true;
                    }
                    if (PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Rivière_Nord, tileId) && PlayerStatic.CheckDirection(tileId, selectedTileId[selectedTileId.Count - 1]) == MYthsAndSteel_Enum.Direction.Nord && !PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Pont_Nord, tileId))
                    {
                        check = true;
                    }
                    if (PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Rivière_Sud, tileId) && PlayerStatic.CheckDirection(tileId, selectedTileId[selectedTileId.Count - 1]) == MYthsAndSteel_Enum.Direction.Sud && !PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Pont_Sud, tileId))
                    {
                        check = true;
                    }
                    if (PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Rivière_Ouest, tileId) && PlayerStatic.CheckDirection(tileId, selectedTileId[selectedTileId.Count - 1]) == MYthsAndSteel_Enum.Direction.Ouest && !PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Pont_Ouest, tileId))
                    {
                        check = true;
                    }
                    if (PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Forêt, tileId) || PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Mont, tileId))
                    {
                        if (mUnit.GetComponent <UnitScript>().MoveLeft >= 2 && !check)
                        {
                            check = true;
                            mUnit.GetComponent <UnitScript>().MoveLeft -= 2; // sup 2 mvmt.
                            selectedTileId.Add(tileId);
                            TilesManager.Instance.TileList[tileId].GetComponent <TileScript>().ActiveChildObj(MYthsAndSteel_Enum.ChildTileType.MoveSelect, _tileSprite);

                            Attaque.Instance.RemoveTileSprite();
                            Attaque.Instance.StartAttackSelectionUnit(tileId);
                        }
                        else if (mUnit.GetComponent <UnitScript>().MoveLeft + mUnit.GetComponent <UnitScript>().MoveSpeedBonus >= 2 && !check)
                        {
                            int moveToDecrease = 2;
                            moveToDecrease -= mUnit.GetComponent <UnitScript>().MoveLeft;
                            mUnit.GetComponent <UnitScript>().MoveLeft        = 0;
                            mUnit.GetComponent <UnitScript>().MoveSpeedBonus -= moveToDecrease;
                        }
                        else if (PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Route, selectedTileId[selectedTileId.Count - 1]) && (mUnit.GetComponent <UnitScript>().MoveLeft + mUnit.GetComponent <UnitScript>().MoveSpeedBonus) == 1 && !RouteBonus && !check)
                        {
                            RouteBonus = true;
                            check      = true;
                            if (mUnit.GetComponent <UnitScript>().MoveLeft > 0)
                            {
                                mUnit.GetComponent <UnitScript>().MoveLeft--;
                            }
                            else
                            {
                                mUnit.GetComponent <UnitScript>().MoveSpeedBonus--;
                            }
                            selectedTileId.Add(tileId);
                            TilesManager.Instance.TileList[tileId].GetComponent <TileScript>().ActiveChildObj(MYthsAndSteel_Enum.ChildTileType.MoveSelect, _tileSprite);

                            Attaque.Instance.RemoveTileSprite();
                            Attaque.Instance.StartAttackSelectionUnit(tileId);
                        }
                        else
                        {
                            check = true;
                            Debug.Log("La tile d'ID : " + tileId + " est une foret ou un mont.");
                        }
                    }
                    if (PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Route, selectedTileId[selectedTileId.Count - 1]) && (mUnit.GetComponent <UnitScript>().MoveLeft + mUnit.GetComponent <UnitScript>().MoveSpeedBonus) == 0 && !RouteBonus)
                    {
                        RouteBonus = true;
                        check      = true;
                        selectedTileId.Add(tileId);
                        TilesManager.Instance.TileList[tileId].GetComponent <TileScript>().ActiveChildObj(MYthsAndSteel_Enum.ChildTileType.MoveSelect, _tileSprite);
                        Attaque.Instance.RemoveTileSprite();
                        Attaque.Instance.StartAttackSelectionUnit(tileId);
                    }
                    if (!check)
                    {
                        if (mUnit.GetComponent <UnitScript>().MoveLeft > 0)
                        {
                            mUnit.GetComponent <UnitScript>().MoveLeft--; // sup 1 mvmt.
                            selectedTileId.Add(tileId);
                            TilesManager.Instance.TileList[tileId].GetComponent <TileScript>().ActiveChildObj(MYthsAndSteel_Enum.ChildTileType.MoveSelect, _tileSprite);

                            Attaque.Instance.RemoveTileSprite();
                            Attaque.Instance.StartAttackSelectionUnit(tileId);
                        }
                        else if (mUnit.GetComponent <UnitScript>().MoveSpeedBonus > 0)
                        {
                            mUnit.GetComponent <UnitScript>().MoveSpeedBonus--; // sup 1 mvmt.
                            selectedTileId.Add(tileId);
                            TilesManager.Instance.TileList[tileId].GetComponent <TileScript>().ActiveChildObj(MYthsAndSteel_Enum.ChildTileType.MoveSelect, _tileSprite);

                            Attaque.Instance.RemoveTileSprite();
                            Attaque.Instance.StartAttackSelectionUnit(tileId);
                        }
                    }
                }    // Sinon, si cette case est bien voisine de l'ancienne selection.
                else // Sinon cette case est trop loin de l'ancienne seletion.
                {
                    Debug.Log("La tile d'ID : " + tileId + " est trop loin de la tile d'ID: " + selectedTileId[selectedTileId.Count - 1]);
                }
            }
            // Sinon cette case est hors de la range de l'unité.
            else
            {
                Debug.Log("La tile d'ID : " + tileId + " est trop loin de la tile d'ID: " + selectedTileId[selectedTileId.Count - 1]);
            }
        }
        if (selectedTileId.Count > 1 && TilesManager.Instance.TileList[selectedTileId[selectedTileId.Count - 1]].GetComponent <TileScript>().Unit == null)
        {
            UIInstance.Instance.ActivationUnitPanel.ShowMovementPanel();
        }
        else
        {
            UIInstance.Instance.ActivationUnitPanel.CloseMovementPanel();
        }
        //DisplayMoveArrow();
    }
Beispiel #3
0
    public void LaunchDéploiementAccéléré()
    {
        UIInstance.Instance.ActivateNextPhaseButton();

        int player = DeterminArmy(MYthsAndSteel_Enum.EventCard.Déploiement_accéléré);
        List <GameObject> gamList = new List <GameObject>();

        //obtien les cases voisines pour chaque unité de l'armée
        foreach (GameObject unit in player == 1? PlayerScript.Instance.UnitRef.UnitListRedPlayer : PlayerScript.Instance.UnitRef.UnitListBluePlayer)
        {
            List <int> neighTile = PlayerStatic.GetNeighbourDiag(unit.GetComponent <UnitScript>().ActualTiledId, TilesManager.Instance.TileList[unit.GetComponent <UnitScript>().ActualTiledId].GetComponent <TileScript>().Line, false);

            //Check les effets de terrain pour voir si il doit ajouter la tile à la liste
            foreach (int i in neighTile)
            {
                //Obtient la direction de la case par rapport à l'unité
                MYthsAndSteel_Enum.Direction dir = PlayerStatic.CheckDirection(unit.GetComponent <UnitScript>().ActualTiledId, i);

                if (TilesManager.Instance.TileList[i].GetComponent <TileScript>().TerrainEffectList.Contains(MYthsAndSteel_Enum.TerrainType.Ravin) || TilesManager.Instance.TileList[i].GetComponent <TileScript>().TerrainEffectList.Contains(MYthsAndSteel_Enum.TerrainType.Eau))
                {
                    //La tile n'est pas ajoutée
                }
                else
                {
                    switch (dir)
                    {
                    case MYthsAndSteel_Enum.Direction.Nord:
                        if (!TilesManager.Instance.TileList[i].GetComponent <TileScript>().TerrainEffectList.Contains(MYthsAndSteel_Enum.TerrainType.Rivière_Sud))
                        {
                            gamList.Add(TilesManager.Instance.TileList[i]);
                        }
                        break;

                    case MYthsAndSteel_Enum.Direction.Sud:
                        if (!TilesManager.Instance.TileList[i].GetComponent <TileScript>().TerrainEffectList.Contains(MYthsAndSteel_Enum.TerrainType.Rivière_Nord))
                        {
                            gamList.Add(TilesManager.Instance.TileList[i]);
                        }
                        break;

                    case MYthsAndSteel_Enum.Direction.Est:
                        if (!TilesManager.Instance.TileList[i].GetComponent <TileScript>().TerrainEffectList.Contains(MYthsAndSteel_Enum.TerrainType.Rivière_Ouest))
                        {
                            gamList.Add(TilesManager.Instance.TileList[i]);
                        }
                        break;

                    case MYthsAndSteel_Enum.Direction.Ouest:
                        if (!TilesManager.Instance.TileList[i].GetComponent <TileScript>().TerrainEffectList.Contains(MYthsAndSteel_Enum.TerrainType.Rivière_Est))
                        {
                            gamList.Add(TilesManager.Instance.TileList[i]);
                        }
                        break;
                    }
                }
            }
        }

        if ((GameManager.Instance.ActualTurnPhase == MYthsAndSteel_Enum.PhaseDeJeu.ActionJ1 || GameManager.Instance.ActualTurnPhase == MYthsAndSteel_Enum.PhaseDeJeu.ActionJ2) &&
            ((player == 1 && GameManager.Instance.IsPlayerRedTurn) || (player == 2 && !GameManager.Instance.IsPlayerRedTurn)))
        {
            LaunchEventTile(1, player == 1 ? true : false, gamList, "Déploiement accéléré", "Êtes-vous sur de vouloir créer une unité d'infanterie sur cette case?");
            GameManager.Instance._eventCall += DéploiementAccéléré;
        }
    }
Beispiel #4
0
 /// <summary>
 /// Cette fonction "highlight" les cases atteignables par l'unité sur la case sélectionnée.
 /// </summary>
 /// <param name="tileId">Tile centrale</param>
 /// <param name="Range">Range de l'unité</param>
 public void Highlight(int tileId, int Range, int lasttileId)
 {
     if (Range > 0)
     {
         foreach (int ID in PlayerStatic.GetNeighbourDiag(tileId, TilesManager.Instance.TileList[tileId].GetComponent <TileScript>().Line, false))
         {
             if (ID == lasttileId)
             {
                 continue;
             }
             TileScript TileSc = TilesManager.Instance.TileList[ID].GetComponent <TileScript>();
             bool       i      = false;
             if (GameManager.Instance.IsPlayerRedTurn)
             {
                 if (TilesManager.Instance.TileList[ID].GetComponent <TileScript>().Unit != null)
                 {
                     if (!TilesManager.Instance.TileList[ID].GetComponent <TileScript>().Unit.GetComponent <UnitScript>().UnitSO.IsInRedArmy)
                     {
                         i = true;
                     }
                     if (TilesManager.Instance.TileList[ID].GetComponent <TileScript>().Unit.GetComponent <UnitScript>().UnitSO.IsInRedArmy&& Range == 1)
                     {
                         i = true;
                     }
                 }
             }
             if (!GameManager.Instance.IsPlayerRedTurn)
             {
                 if (TilesManager.Instance.TileList[ID].GetComponent <TileScript>().Unit != null)
                 {
                     if (TilesManager.Instance.TileList[ID].GetComponent <TileScript>().Unit.GetComponent <UnitScript>().UnitSO.IsInRedArmy)
                     {
                         i = true;
                     }
                     if (!TilesManager.Instance.TileList[ID].GetComponent <TileScript>().Unit.GetComponent <UnitScript>().UnitSO.IsInRedArmy&& Range == 1)
                     {
                         i = true;
                     }
                 }
             }
             foreach (MYthsAndSteel_Enum.TerrainType Type in TileSc.TerrainEffectList)
             {
                 if (EffectToCheck.Contains(Type))
                 {
                     if (PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Ravin, ID) || PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Eau, ID))
                     {
                         i = true;
                         break;
                     }
                     if (PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Rivière_Est, tileId) && PlayerStatic.CheckDirection(tileId, ID) == MYthsAndSteel_Enum.Direction.Est && !PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Pont_Est, tileId))
                     {
                         i = true;
                         break;
                     }
                     if (PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Rivière_Nord, tileId) && PlayerStatic.CheckDirection(tileId, ID) == MYthsAndSteel_Enum.Direction.Nord && !PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Pont_Nord, tileId))
                     {
                         i = true;
                         break;
                     }
                     if (PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Rivière_Sud, tileId) && PlayerStatic.CheckDirection(tileId, ID) == MYthsAndSteel_Enum.Direction.Sud && !PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Pont_Sud, tileId))
                     {
                         i = true;
                         break;
                     }
                     if (PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Rivière_Ouest, tileId) && PlayerStatic.CheckDirection(tileId, ID) == MYthsAndSteel_Enum.Direction.Ouest && !PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Pont_Ouest, tileId))
                     {
                         i = true;
                         break;
                     }
                     if (PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Mont, ID) || PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Forêt, ID))
                     {
                         if (Range >= 2 && !i)
                         {
                             i = true;
                             TilesManager.Instance.TileList[ID].GetComponent <TileScript>().ActiveChildObj(MYthsAndSteel_Enum.ChildTileType.MoveSelect, _selectedSprite);
                             if (!newNeighbourId.Contains(ID))
                             {
                                 newNeighbourId.Add(ID);
                             }
                             Highlight(ID, Range - 2, tileId);
                             break;
                         }
                         else
                         {
                             i = true;
                             break;
                         }
                     }
                 }
             }
             if (!i)
             {
                 TilesManager.Instance.TileList[ID].GetComponent <TileScript>().ActiveChildObj(MYthsAndSteel_Enum.ChildTileType.MoveSelect, _selectedSprite);
                 if (!newNeighbourId.Contains(ID))
                 {
                     newNeighbourId.Add(ID);
                 }
                 Highlight(ID, Range - 1, tileId);
             }
         }
     }
     // Si il s'agit d'une route et que la range est de 0.
     if (PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Route, tileId) && Range == 0)
     {
         foreach (int ID in PlayerStatic.GetNeighbourDiag(tileId, TilesManager.Instance.TileList[tileId].GetComponent <TileScript>().Line, false))
         {
             if (ID == lasttileId)
             {
                 continue;
             }
             TileScript TileSc = TilesManager.Instance.TileList[ID].GetComponent <TileScript>();
             bool       i      = false;
             if (TilesManager.Instance.TileList[ID].GetComponent <TileScript>().Unit != null)
             {
                 i = true;
             }
             foreach (MYthsAndSteel_Enum.TerrainType Type in TileSc.TerrainEffectList)
             {
                 if (EffectToCheck.Contains(Type))
                 {
                     if (PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Ravin, ID) || PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Eau, ID))
                     {
                         i = true;
                         break;
                     }
                     if (PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Rivière_Est, tileId) && PlayerStatic.CheckDirection(tileId, ID) == MYthsAndSteel_Enum.Direction.Est && !PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Pont_Est, tileId))
                     {
                         i = true;
                         break;
                     }
                     if (PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Rivière_Nord, tileId) && PlayerStatic.CheckDirection(tileId, ID) == MYthsAndSteel_Enum.Direction.Nord && !PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Pont_Nord, tileId))
                     {
                         i = true;
                         break;
                     }
                     if (PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Rivière_Sud, tileId) && PlayerStatic.CheckDirection(tileId, ID) == MYthsAndSteel_Enum.Direction.Sud && !PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Pont_Sud, tileId))
                     {
                         i = true;
                         break;
                     }
                     if (PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Rivière_Ouest, tileId) && PlayerStatic.CheckDirection(tileId, ID) == MYthsAndSteel_Enum.Direction.Ouest && !PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Pont_Ouest, tileId))
                     {
                         i = true;
                         break;
                     }
                     if (PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Mont, ID) || PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Forêt, ID))
                     {
                         i = true;
                     }
                 }
             }
             if (!i)
             {
                 TilesManager.Instance.TileList[ID].GetComponent <TileScript>().ActiveChildObj(MYthsAndSteel_Enum.ChildTileType.MoveSelect, _selectedSprite);
                 if (!newNeighbourId.Contains(ID))
                 {
                     newNeighbourId.Add(ID);
                 }
                 Highlight(ID, -1, tileId);
             }
         }
     }
     // Si il s'agit d'une route et que la range est de 1.
     if (PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Route, tileId) && Range == 1)
     {
         foreach (int ID in PlayerStatic.GetNeighbourDiag(tileId, TilesManager.Instance.TileList[tileId].GetComponent <TileScript>().Line, false))
         {
             if (ID == lasttileId)
             {
                 continue;
             }
             TileScript TileSc = TilesManager.Instance.TileList[ID].GetComponent <TileScript>();
             bool       i      = false;
             if (TilesManager.Instance.TileList[ID].GetComponent <TileScript>().Unit != null)
             {
                 i = true;
             }
             foreach (MYthsAndSteel_Enum.TerrainType Type in TileSc.TerrainEffectList)
             {
                 if (EffectToCheck.Contains(Type))
                 {
                     if (PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Ravin, ID) || PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Eau, ID))
                     {
                         i = true;
                         break;
                     }
                     if (PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Rivière_Est, tileId) && PlayerStatic.CheckDirection(tileId, ID) == MYthsAndSteel_Enum.Direction.Est && !PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Pont_Est, tileId))
                     {
                         i = true;
                         break;
                     }
                     if (PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Rivière_Nord, tileId) && PlayerStatic.CheckDirection(tileId, ID) == MYthsAndSteel_Enum.Direction.Nord && !PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Pont_Nord, tileId))
                     {
                         i = true;
                         break;
                     }
                     if (PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Rivière_Sud, tileId) && PlayerStatic.CheckDirection(tileId, ID) == MYthsAndSteel_Enum.Direction.Sud && !PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Pont_Sud, tileId))
                     {
                         i = true;
                         break;
                     }
                     if (PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Rivière_Ouest, tileId) && PlayerStatic.CheckDirection(tileId, ID) == MYthsAndSteel_Enum.Direction.Ouest && !PlayerStatic.CheckTiles(MYthsAndSteel_Enum.TerrainType.Pont_Ouest, tileId))
                     {
                         i = true;
                         break;
                     }
                 }
             }
             if (!i)
             {
                 TilesManager.Instance.TileList[ID].GetComponent <TileScript>().ActiveChildObj(MYthsAndSteel_Enum.ChildTileType.MoveSelect, _selectedSprite);
                 if (!newNeighbourId.Contains(ID))
                 {
                     newNeighbourId.Add(ID);
                 }
                 Highlight(ID, -1, lasttileId);
             }
         }
     }
 }