From f8eed62a9f08d08ffa7ceb7b543fdef5ea07bfb6 Mon Sep 17 00:00:00 2001 From: Ashby Issac Date: Thu, 29 Jan 2026 22:16:54 +0530 Subject: [PATCH] Refix: Dice roll. --- Assets/Scripts/Gameplay/GameplayManager.cs | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Assets/Scripts/Gameplay/GameplayManager.cs b/Assets/Scripts/Gameplay/GameplayManager.cs index d8f82a8..d575cdb 100644 --- a/Assets/Scripts/Gameplay/GameplayManager.cs +++ b/Assets/Scripts/Gameplay/GameplayManager.cs @@ -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; }