Refix: Dice roll.
This commit is contained in:
parent
4fd71569ef
commit
f8eed62a9f
@ -238,7 +238,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
{
|
||||
Debug.Log($"Switching player");
|
||||
SwitchPlayer();
|
||||
SetCanRollDiceForUser(currentPlayerTypeTurn, true);
|
||||
SetCanRollDiceForUser(true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -425,7 +425,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
|
||||
public void OnDiceRolled(int rolledVal)
|
||||
{
|
||||
SetCanRollDiceForUser(currentPlayerTypeTurn, false);
|
||||
SetCanRollDiceForUser(false);
|
||||
|
||||
// add core dice logic here
|
||||
Debug.Log($"Tile Index :: LUDO :: rolledVal: {rolledVal} :: {currentPlayerTypeTurn}");
|
||||
@ -449,7 +449,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
Debug.Log($"### AreAllPawnsInFinishingPath");
|
||||
if (AreAllPawnsInFinishingPath())
|
||||
{
|
||||
SetCanRollDiceForUser(currentPlayerTypeTurn, true);
|
||||
SetCanRollDiceForUser(true);
|
||||
|
||||
return;
|
||||
}
|
||||
@ -570,7 +570,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
if (playerPawn.IsBotPlayer)
|
||||
CheckDiceRollForBot(playerPawn);
|
||||
else
|
||||
SetCanRollDiceForUser(playerPawn.PlayerType, true);
|
||||
SetCanRollDiceForUser(true);
|
||||
|
||||
}, playerGameData.startIndex);
|
||||
|
||||
@ -670,6 +670,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
diceText.text = $"{0}";
|
||||
}
|
||||
|
||||
SetCanRollDiceForUser(!botTypesInGame.Contains(currentPlayerTypeTurn));
|
||||
Debug.Log($"CurrentPlayerTurn: {currentPlayerTypeTurn}");
|
||||
var tempPos = playerBaseHandler.GetPlayerBase(currentPlayerTypeTurn).transform.position;
|
||||
pointerDebug.position = new Vector3(tempPos.x, 3f, tempPos.z);
|
||||
@ -771,7 +772,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
if (playerPawn.IsBotPlayer)
|
||||
CheckDiceRollForBot(playerPawn);
|
||||
else
|
||||
SetCanRollDiceForUser(playerPawn.PlayerType, true);
|
||||
SetCanRollDiceForUser(true);
|
||||
}
|
||||
|
||||
nextTile.InitPlayerPawn(playerPawn, currentPlayerTypeTurn);
|
||||
@ -791,7 +792,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
SwitchPlayer(playerPawn);
|
||||
if (!CanRollDiceAgain)
|
||||
{
|
||||
SetCanRollDiceForUser(playerPawn.PlayerType, true);
|
||||
SetCanRollDiceForUser(true);
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -906,22 +907,22 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
{
|
||||
if (CheckForMaxDiceRollAttempt())
|
||||
{
|
||||
SetCanRollDiceForUser(playerPawn.PlayerType, true);
|
||||
SetCanRollDiceForUser(true);
|
||||
return;
|
||||
}
|
||||
|
||||
SwitchPlayer();
|
||||
}
|
||||
|
||||
SetCanRollDiceForUser(playerPawn.PlayerType, true);
|
||||
SetCanRollDiceForUser(true);
|
||||
}
|
||||
},
|
||||
index);
|
||||
}
|
||||
|
||||
private void SetCanRollDiceForUser(PlayerType playerType, bool state)
|
||||
private void SetCanRollDiceForUser(bool state)
|
||||
{
|
||||
if (botTypesInGame.Contains(playerType)) return;
|
||||
// if (botTypesInGame.Contains(playerType)) return;
|
||||
|
||||
CanRollDice = state;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user