mirror of
https://github.com/smyalygames/monopoly.git
synced 2025-05-18 14:24:12 +02:00
Allowed buying property and next turn
This commit is contained in:
parent
1b8bf63ae2
commit
f81194c110
@ -1,5 +1,6 @@
|
|||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
public class AI
|
public class AI
|
||||||
{
|
{
|
||||||
@ -32,6 +33,7 @@ public class AI
|
|||||||
/* TASK DESCRIPTIONS:
|
/* TASK DESCRIPTIONS:
|
||||||
* 0 - Move
|
* 0 - Move
|
||||||
* 1 - Buy
|
* 1 - Buy
|
||||||
|
* 99 - End Turn
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public AI(int money)
|
public AI(int money)
|
||||||
@ -52,16 +54,23 @@ public class AI
|
|||||||
//The AI will decide to move.
|
//The AI will decide to move.
|
||||||
RollDice(); //The AI will roll the dice.
|
RollDice(); //The AI will roll the dice.
|
||||||
currentTask = 0; //It will set the current task to 0 to represent movement.
|
currentTask = 0; //It will set the current task to 0 to represent movement.
|
||||||
|
startedRound = true;
|
||||||
}
|
}
|
||||||
else if (buyProperty)
|
else if (buyProperty)
|
||||||
{
|
{
|
||||||
currentTask = 1; //This will buy a property.
|
currentTask = 1; //This will buy a property.
|
||||||
buyProperty = false;
|
buyProperty = false;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Log("I NEED TO FINISH");
|
||||||
|
currentTask = 99;
|
||||||
|
startedRound = false;
|
||||||
|
}
|
||||||
return currentTask;
|
return currentTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RollDice()
|
private void RollDice()
|
||||||
{
|
{
|
||||||
dice1 = random.Next(1, 7);
|
dice1 = random.Next(1, 7);
|
||||||
dice2 = random.Next(1, 7);
|
dice2 = random.Next(1, 7);
|
||||||
|
@ -357,6 +357,9 @@ public class Board //Creating the class for the board mechanics.
|
|||||||
case 1: //Buy Property
|
case 1: //Buy Property
|
||||||
BuyProperty();
|
BuyProperty();
|
||||||
break;
|
break;
|
||||||
|
case 99:
|
||||||
|
NextPlayer();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -403,6 +406,7 @@ public class Board //Creating the class for the board mechanics.
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
AINextTask();
|
||||||
players[currentPlayer].AI.buyProperty = false;
|
players[currentPlayer].AI.buyProperty = false;
|
||||||
}
|
}
|
||||||
return false; //Returns false if the property is not buybale.
|
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.DisableBuying(); //Removes the buy button.
|
||||||
buttonHandler.EnableNextTurn();
|
buttonHandler.EnableNextTurn();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AINextTask();
|
||||||
|
}
|
||||||
return; //Stops the function
|
return; //Stops the function
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user