diff --git a/Assets/Scripts/monopoly/AI.cs b/Assets/Scripts/monopoly/AI.cs index 46e957c..d213604 100644 --- a/Assets/Scripts/monopoly/AI.cs +++ b/Assets/Scripts/monopoly/AI.cs @@ -1,5 +1,6 @@ using System.Collections; using System.Collections.Generic; +using UnityEngine; public class AI { @@ -32,6 +33,7 @@ public class AI /* TASK DESCRIPTIONS: * 0 - Move * 1 - Buy + * 99 - End Turn */ public AI(int money) @@ -52,16 +54,23 @@ public class AI //The AI will decide to move. RollDice(); //The AI will roll the dice. currentTask = 0; //It will set the current task to 0 to represent movement. + startedRound = true; } else if (buyProperty) { currentTask = 1; //This will buy a property. buyProperty = false; } + else + { + Debug.Log("I NEED TO FINISH"); + currentTask = 99; + startedRound = false; + } return currentTask; } - public void RollDice() + private void RollDice() { dice1 = random.Next(1, 7); dice2 = random.Next(1, 7); diff --git a/Assets/Scripts/monopoly/Main.cs b/Assets/Scripts/monopoly/Main.cs index 40d7e56..4b3d663 100644 --- a/Assets/Scripts/monopoly/Main.cs +++ b/Assets/Scripts/monopoly/Main.cs @@ -357,6 +357,9 @@ public class Board //Creating the class for the board mechanics. case 1: //Buy Property BuyProperty(); break; + case 99: + NextPlayer(); + break; } } @@ -403,6 +406,7 @@ public class Board //Creating the class for the board mechanics. } else { + AINextTask(); players[currentPlayer].AI.buyProperty = false; } return false; //Returns false if the property is not buybale. @@ -454,6 +458,10 @@ public class Board //Creating the class for the board mechanics. buttonHandler.DisableBuying(); //Removes the buy button. buttonHandler.EnableNextTurn(); } + else + { + AINextTask(); + } return; //Stops the function } }