Ejemplo n.º 1
0
 public void BuyOutOfJail()
 {
     _gameManager.CurrentPlayer.InJail           = false;
     _gameManager.CurrentPlayer.NumOfTurnsInJail = 0;
     if (!_gameManager.CurrentPlayer.BalanceManager.GetMoneyFromPlayer(50))
     {
         return;                                                                            //todo инфа о выходе и нормальное перемещение
     }
     _textLog.LogText(string.Format("{0} выходит из тюрьмы", _gameManager.CurrentPlayer.PlayerName));
     StartCoroutine(_gameManager.RollDice());
 }
Ejemplo n.º 2
0
 public override void LandOn(Player player)
 {
     if (player.CurrentState != Player.State.InJail)
     {
         _textLog.LogText(string.Format("{0} попал на поле {1}", player.PlayerName, this.Name));
     }
 }
Ejemplo n.º 3
0
 public override void LandOn(Player player)
 {
     _textLog.LogText(string.Format("{0} попал на поле {1}", player.PlayerName, this.Name));
     if (this.Owner == null)
     {
         UIManager uiManager = GameObject.Find("UIManager").GetComponent <UIManager>();
         uiManager.OfferBuyProperty();
     }
     else
     {
         if (this.Owner == player)
         {
             _textLog.LogText(string.Format("{0} попал на своё поле", player.PlayerName, this.Name));
         }
         else
         {
             if (!this.IsMortgage)
             {
                 player.BalanceManager.TransferMoneyToPlayer(Owner, Rent());                     //todo улучшить лог
             }
         }
     }
 }
Ejemplo n.º 4
0
 public IEnumerator RollDice()
 {
     DiceRoller.RollDice();
     TextLog.LogText(string.Format("{0} выбросил {1} и {2}", CurrentPlayer.PlayerName, DiceRoller.Dice1, DiceRoller.Dice2));
     yield return(StartCoroutine(CurrentPlayer.MoveTo(Board[NextLocation()])));
 }
Ejemplo n.º 5
0
    public override void LandOn(Player player)
    {
        _gameManager.TextLog.LogText(string.Format("{0} попал на поле {1}", _gameManager.CurrentPlayer.PlayerName, this.Name));
        var numCard       = _gameManager.ChanceCards.Dequeue();
        var indexLocation = Array.IndexOf(_gameManager.Board, player.CurrentLocation);

        _gameManager.ChanceCards.Enqueue(numCard);
        switch (numCard)
        {
        case 0:
            _textLog.LogText("Отправляйтесь на Mayfair");
            StartCoroutine(player.MoveTo(_gameManager.Board[39]));
            break;

        case 1:
            _textLog.LogText("Отправляйтесь на Pall Mall");
            StartCoroutine(player.MoveTo(_gameManager.Board[11]));
            break;

        case 2:
        case 7:
            _textLog.LogText("Отправляйтесь на ближайшую железнодорожную станцию");
            switch (indexLocation)
            {
            case 7:
                StartCoroutine(player.MoveTo(_gameManager.Board[15]));
                break;

            case 22:
                StartCoroutine(player.MoveTo(_gameManager.Board[25]));
                break;

            case 36:
                StartCoroutine(player.MoveTo(_gameManager.Board[5]));
                break;
            }
            break;

        case 3:
            _textLog.LogText("Получите 50£");
            player.BalanceManager.GiveMoneyToPlayer(50);
            break;

        case 4:
            _textLog.LogText("Отправляйтесь на ближайшее коммунальное предприятие");
            switch (indexLocation)
            {
            case 7:
            case 36:
                StartCoroutine(player.MoveTo(_gameManager.Board[12]));
                break;

            case 22:
                StartCoroutine(player.MoveTo(_gameManager.Board[28]));
                break;
            }
            break;

        case 5:
            _textLog.LogText("Отправляйтесь в тюрьму");
            _gameManager.JailManager.PutPLayerInJail();
            break;

        case 6:
            _textLog.LogText("Отправляйтесь на Kings Cross Station");
            StartCoroutine(player.MoveTo(_gameManager.Board[5]));
            break;

        case 8:
            _textLog.LogText("Отдайте 15£");
            player.BalanceManager.GetMoneyFromPlayer(15);
            break;                     //TODO информирование о потере денег

        case 9:
            _textLog.LogText("Отправляйтесь на бесплатную стоянку");
            StartCoroutine(player.MoveTo(_gameManager.Board[20]));
            break;

        case 10:
            _textLog.LogText("Получите 150£");
            player.BalanceManager.GiveMoneyToPlayer(150);
            break;

        case 11:
            _textLog.LogText("Отправляйтесь на Trafalgar Square");
            StartCoroutine(player.MoveTo(_gameManager.Board[24]));
            break;

        case 12:
            _textLog.LogText("Идите на 3 ячейки назад");
            StartCoroutine(player.MoveTo(_gameManager.Board[indexLocation - 3]));
            break;

        case 13:
            _textLog.LogText("Отправляйтесь на поле Вперёд");
            StartCoroutine(player.MoveTo(_gameManager.Board[0]));
            break;
        }
    }
Ejemplo n.º 6
0
 public override void LandOn(Player player)
 {
     _textLog.LogText(string.Format("{0} попал на поле {1}", player.PlayerName, this.Name));
 }
Ejemplo n.º 7
0
 public void GiveMoneyToPlayer(int money)
 {
     Balance += money;
     _textLog.LogText(string.Format("Игрок {0} получает {1}£", _player.PlayerName, money));
 }
Ejemplo n.º 8
0
 public override void LandOn(Player player)
 {
     _textLog.LogText(string.Format("{0} попал на поле {1}", player.PlayerName, this.Name));
     _gameManager.JailManager.PutPLayerInJail();
 }
Ejemplo n.º 9
0
    public override void LandOn(Player player)
    {
        _gameManager.TextLog.LogText(string.Format("{0} попал на поле {1}", _gameManager.CurrentPlayer.PlayerName, this.Name));
        var numCard = _gameManager.ChanceCards.Dequeue();

        _gameManager.ChanceCards.Enqueue(numCard);
        switch (numCard)
        {
        case 0:
            _textLog.LogText("Отправляйтесь в тюрьму");
            _gameManager.JailManager.PutPLayerInJail();
            break;

        case 1:
            _textLog.LogText("Отправляйтесь на поле Вперёд");
            StartCoroutine(player.MoveTo(_gameManager.Board[0]));
            break;

        case 2:
            _textLog.LogText("Заплатите 50£");
            player.BalanceManager.GetMoneyFromPlayer(50);
            break;

        case 3:
            _textLog.LogText("Получите 10£");
            player.BalanceManager.GiveMoneyToPlayer(10);
            break;

        case 4:
            _textLog.LogText("Получите 50£");
            player.BalanceManager.GiveMoneyToPlayer(50);
            break;

        case 5:
            _textLog.LogText("Получите 200£");
            player.BalanceManager.GiveMoneyToPlayer(200);
            break;

        case 6:
            _textLog.LogText("Заплатите 100£");
            player.BalanceManager.GetMoneyFromPlayer(100);
            break;

        case 7:
            _textLog.LogText("Получите 100£");
            player.BalanceManager.GiveMoneyToPlayer(100);
            break;

        case 8:
            _textLog.LogText("Отправляйтесь на бесплатную стоянку");
            StartCoroutine(player.MoveTo(_gameManager.Board[20]));
            break;

        case 9:
            _textLog.LogText("Получите 20£");
            player.BalanceManager.GiveMoneyToPlayer(20);
            break;

        case 10:
        case 12:
            _textLog.LogText("Получите 100£");
            player.BalanceManager.GiveMoneyToPlayer(100);
            break;

        case 11:
            _textLog.LogText("Заплатите 50£");
            player.BalanceManager.GetMoneyFromPlayer(50);
            break;

        case 13:
            _textLog.LogText("Получите 25£");
            player.BalanceManager.GiveMoneyToPlayer(25);
            break;
        }
    }
Ejemplo n.º 10
0
 public override void LandOn(Player player)
 {
     _textLog.LogText(string.Format("{0} попал на поле {1}", player.PlayerName, this.Name));
     player.BalanceManager.GetMoneyFromPlayer(_taxCost);
 }