Esempio n. 1
0
    internal void TakenMove(int moveValue = 1)
    {
        activePlayer.income = GenerateIncomeForPlayer(activePlayer.diceOwned);
        Debug.Log($"Taking {moveValue} form {activePlayer.name}, now at {activePlayer.numberOfMoves - moveValue}, with +{activePlayer.income}");
        activePlayer.numberOfMoves -= moveValue;
        if (activePlayer.numberOfMoves <= 0)
        {
            gameControl.DisalowInput();
            if (gameControl.currentySelected != null)
            {
                gameControl.currentySelected.SetDeselected();
                gameControl.currentySelected = null;
            }

            NextPlayer();
        }
        else
        {
            gameControl.ui_Control.UpdateMovesDisplay(activePlayer.numberOfMoves, activePlayer.income);
            if (activePlayer.ai == null)
            {
                gameControl.AllowInput();
            }
        }
    }
Esempio n. 2
0
 internal async void CalculateBasesAttackEnemy(Dice_Control OwenDice, Dice_Control targetDice)
 {
     if (targetDice.isBase)
     {
         //Debug.Log($"Invlaid Move bases can't attack bases");
         InvalidMove(targetDice.tileControl);
     }
     else
     {
         if (targetDice.currentValue > 1)
         {
             await targetDice.AnimateDiceValueChange(targetDice.currentValue - 1);//defending base attack value
         }
         else
         {
             targetDice.tileControl.RemoveDiceOnTile();
             DestroySingleDice(targetDice);
         }
         gameControl.audioManager.PlaySound("outpostAttack");
         gameControl.playerControl.TakenMove(1);
         gameControl.AllowInput();
     }
 }