Compare commits
No commits in common. "a291dff12161dd9ca25c8fe71fccdfc3c0061ee2" and "874e44a7f7343ddc19f9be4e378bcb5b1a2bb532" have entirely different histories.
a291dff121
...
874e44a7f7
@ -319,90 +319,6 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 28556634}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &34262131
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 34262132}
|
||||
- component: {fileID: 34262133}
|
||||
m_Layer: 0
|
||||
m_Name: Safe Tile img
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &34262132
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 34262131}
|
||||
m_LocalRotation: {x: -0.7071068, y: -0, z: -0, w: 0.7071068}
|
||||
m_LocalPosition: {x: 0, y: 3.212, z: 0}
|
||||
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 359456887}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0}
|
||||
--- !u!212 &34262133
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 34262131}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 0
|
||||
m_RayTraceProcedural: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 0
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_Sprite: {fileID: 21300000, guid: d20b33310cfd64c4f84b7443a0b6245b, type: 3}
|
||||
m_Color: {r: 0.31361735, g: 0.5568628, b: 0, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 3.84, y: 3.84}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!1 &34897982
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -2473,90 +2389,6 @@ MeshFilter:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 207890302}
|
||||
m_Mesh: {fileID: 4300004, guid: 25e0b84f10949354b96b98b3742acdde, type: 3}
|
||||
--- !u!1 &208504447
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 208504448}
|
||||
- component: {fileID: 208504449}
|
||||
m_Layer: 0
|
||||
m_Name: Safe Tile img
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &208504448
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 208504447}
|
||||
m_LocalRotation: {x: -0.7071068, y: -0, z: -0, w: 0.7071068}
|
||||
m_LocalPosition: {x: 0, y: 3.212, z: 0}
|
||||
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 937729790}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0}
|
||||
--- !u!212 &208504449
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 208504447}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 0
|
||||
m_RayTraceProcedural: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 0
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_Sprite: {fileID: 21300000, guid: d20b33310cfd64c4f84b7443a0b6245b, type: 3}
|
||||
m_Color: {r: 0.31361735, g: 0.5568628, b: 0, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 3.84, y: 3.84}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!1001 &209365733
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -9044,7 +8876,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 0483b263e22fc433caab31141efbe319, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
diceValue: 6
|
||||
diceValue: 0
|
||||
diceText: {fileID: 953941044}
|
||||
pointerDebug: {fileID: 102349503}
|
||||
pointerMeshRend: {fileID: 102349501}
|
||||
@ -9919,90 +9751,6 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 114033ff484fb492290f3118615ad4d8, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &948796889
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 948796890}
|
||||
- component: {fileID: 948796891}
|
||||
m_Layer: 0
|
||||
m_Name: Safe Tile img
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &948796890
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 948796889}
|
||||
m_LocalRotation: {x: -0.64085644, y: -0.29883623, z: -0.29883623, w: 0.64085644}
|
||||
m_LocalPosition: {x: 0, y: 3.212, z: 0}
|
||||
m_LocalScale: {x: 0.49999994, y: 0.49999994, z: 0.5}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 839569478}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0}
|
||||
--- !u!212 &948796891
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 948796889}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 0
|
||||
m_RayTraceProcedural: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 0
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_Sprite: {fileID: 21300000, guid: d20b33310cfd64c4f84b7443a0b6245b, type: 3}
|
||||
m_Color: {r: 0.31361735, g: 0.5568628, b: 0, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 3.84, y: 3.84}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!1 &949967772
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -21621,90 +21369,6 @@ Transform:
|
||||
m_Father: {fileID: 777143461}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0}
|
||||
--- !u!1 &2006742110
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2006742111}
|
||||
- component: {fileID: 2006742112}
|
||||
m_Layer: 0
|
||||
m_Name: Safe Tile img
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &2006742111
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2006742110}
|
||||
m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068}
|
||||
m_LocalPosition: {x: 0, y: 3.212, z: 0}
|
||||
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1778287703}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0}
|
||||
--- !u!212 &2006742112
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2006742110}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 0
|
||||
m_RayTraceProcedural: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 0
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_Sprite: {fileID: 21300000, guid: d20b33310cfd64c4f84b7443a0b6245b, type: 3}
|
||||
m_Color: {r: 0.31361735, g: 0.5568628, b: 0, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 3.84, y: 3.84}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!1 &2015309188
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using DG.Tweening;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
@ -81,7 +80,6 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
public void Initialize()
|
||||
{
|
||||
InterfaceManager.Instance?.RegisterInterface<GameplayManager>(this);
|
||||
DOTween.useSafeMode = false;
|
||||
}
|
||||
|
||||
public void InitializeData()
|
||||
@ -236,7 +234,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
{
|
||||
Debug.Log($"Switching player");
|
||||
SwitchPlayer();
|
||||
SetCanRollDiceForUser(currentPlayerTypeTurn, true);
|
||||
CanRollDice = true;
|
||||
}
|
||||
// else if (botTypesInGame.Contains(currentPlayerTypeTurn) && CanRollDiceAgain)
|
||||
// {
|
||||
@ -312,7 +310,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
|
||||
Debug.Log($"AI playerPawn :: {playerPawn.name} :: state: {playerPawn.GetPlayerState()}, possibleLandingIndex: {possibleLandingIndex > playerGameDatasDict[currentPlayerTypeTurn].endIndex}");
|
||||
Debug.Log($"AI playerPawn :: {playerPawn.name} :: possibleTileData.IsSafeZone: {possibleTileData.IsSafeZone}");
|
||||
Debug.Log($"AI playerPawn :: {playerPawn.name} :: possibleTileData.PlayerPawn: {possibleTileData.HasPawnsAvailable}");
|
||||
Debug.Log($"AI playerPawn :: {playerPawn.name} :: possibleTileData.PlayerPawn: {possibleTileData.PlayerPawn}");
|
||||
|
||||
if (playerPawn.GetPlayerState() == PlayerState.InFinishingPath || possibleLandingIndex > playerGameDatasDict[currentPlayerTypeTurn].endIndex)
|
||||
{
|
||||
@ -333,7 +331,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
Debug.Log($"AI playerPawn :: {playerPawn.name} :: {playerPawn.PlayerId} :: safeMove");
|
||||
botPawnsDictForCurrentPlayer[playerPawn.PlayerId] = BotMove.SafeMove;
|
||||
}
|
||||
else if (possibleTileData.HasPawnsAvailable)
|
||||
else if (possibleTileData.PlayerPawn != null)
|
||||
{
|
||||
Debug.Log($"AI playerPawn :: {playerPawn.name} :: {playerPawn.PlayerId} :: attackMove");
|
||||
botPawnsDictForCurrentPlayer[playerPawn.PlayerId] = BotMove.AttackMove;
|
||||
@ -416,7 +414,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
|
||||
public void OnDiceRolled(int rolledVal)
|
||||
{
|
||||
SetCanRollDiceForUser(currentPlayerTypeTurn, false);
|
||||
CanRollDice = false;
|
||||
|
||||
// add core dice logic here
|
||||
Debug.Log($"Tile Index :: LUDO :: rolledVal: {rolledVal} :: {currentPlayerTypeTurn}");
|
||||
@ -439,7 +437,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
Debug.Log($"### AreAllPawnsInFinishingPath");
|
||||
if (AreAllPawnsInFinishingPath())
|
||||
{
|
||||
SetCanRollDiceForUser(currentPlayerTypeTurn, true);
|
||||
CanRollDice = true;
|
||||
|
||||
return;
|
||||
}
|
||||
@ -552,7 +550,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
{
|
||||
playerGameDatasDict[playerGameData.playerType].totalPawnsInHome--;
|
||||
|
||||
SetCanRollDiceForUser(playerPawn.PlayerType, true);
|
||||
CanRollDice = true;
|
||||
UpdatePlayerState(playerPawn, PlayerState.InSafeZone);
|
||||
if (playerPawn.IsBotPlayer)
|
||||
CheckDiceRollForBot(playerPawn);
|
||||
@ -561,14 +559,15 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
|
||||
return;
|
||||
}
|
||||
else if (playerPawn.GetPlayerState() == PlayerState.InFinishingPath)
|
||||
else if (playerPawn.GetPlayerState() == PlayerState.InFinishingPath
|
||||
|| playerPawn.CurrentTileIndex == playerGameDatasDict[currentPlayerTypeTurn].endIndex)
|
||||
{
|
||||
ApplyFinishingPathLogic(playerPawn);
|
||||
}
|
||||
else if (playerPawn.CurrentTileIndex == playerGameDatasDict[currentPlayerTypeTurn].endIndex)
|
||||
{
|
||||
tilesManager.RetrieveTileBasedOnIndex(playerPawn.CurrentTileIndex).ResetPlayerPawn(playerPawn);
|
||||
ApplyFinishingPathLogic(playerPawn);
|
||||
int finishingPathIndex = GetNextFinishingTileIndex(playerPawn);
|
||||
int targetIdx = finishingPathIndex + diceRolledValue > tilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn) - 1 ?
|
||||
tilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn) - 1 : finishingPathIndex + diceRolledValue;
|
||||
|
||||
Debug.Log($"TargetIdx: {targetIdx}, finishingPathIndex: {finishingPathIndex}");
|
||||
MoveThroughFinishingPath(playerPawn, finishingPathIndex, targetIdx);
|
||||
}
|
||||
else if (playerPawn.GetPlayerState() == PlayerState.InSafeZone || playerPawn.GetPlayerState() == PlayerState.Moving)
|
||||
{
|
||||
@ -597,24 +596,13 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
}
|
||||
else
|
||||
{
|
||||
currentSittingTile.ResetPlayerPawn(playerPawn);
|
||||
currentSittingTile.ResetPlayerPawn();
|
||||
}
|
||||
|
||||
MoveThroughTiles(playerPawn, nextTileIdx, targetIndex: targetIdx);
|
||||
}
|
||||
}
|
||||
|
||||
private void ApplyFinishingPathLogic(PlayerPawn playerPawn)
|
||||
{
|
||||
int finishingPathIndex = GetNextFinishingTileIndex(playerPawn);
|
||||
int targetIdx = finishingPathIndex + diceRolledValue > tilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn) - 1 ?
|
||||
tilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn) - 1 : finishingPathIndex + diceRolledValue;
|
||||
|
||||
Debug.Log($"TargetIdx: {targetIdx}, finishingPathIndex: {finishingPathIndex}");
|
||||
MoveThroughFinishingPath(playerPawn, finishingPathIndex, targetIdx);
|
||||
}
|
||||
|
||||
|
||||
public int GetNextGeneralTileIndex(PlayerPawn playerPawn)
|
||||
{
|
||||
return playerPawn.CurrentTileIndex == tilesManager.GetGeneralTilesLength() - 1 ? 0 : playerPawn.CurrentTileIndex + 1;
|
||||
@ -722,45 +710,25 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
Debug.Log($"nextTile.IsSafeZone: {nextTile.IsSafeZone}");
|
||||
if (!nextTile.IsSafeZone)
|
||||
{
|
||||
Debug.Log($"nextTile.HasPawnsAvailable: {nextTile.HasPawnsAvailable}");
|
||||
if (nextTile.HasPawnsAvailable && playerPawn.PlayerType != nextTile.CurrentHoldingPlayerType)
|
||||
Debug.Log($"nextTile.PlayerPawn: {nextTile.PlayerPawn}, {nextTile.transform.name}");
|
||||
if (nextTile.PlayerPawn != null && playerPawn.PlayerType != nextTile.PlayerPawn.PlayerType)
|
||||
{
|
||||
Debug.Log($"nextTile.PlayerPawn: {nextTile.CurrentHoldingPlayerType}, {nextTile.transform.name}");
|
||||
Debug.Log($"nextTile.TotalPawnsInTile: {nextTile.TotalPawnsInTile}");
|
||||
// play animation for moving back to base.
|
||||
// TODO :: Send existing pawn back to base.
|
||||
// means there's already a pawn there, move him back to the base.
|
||||
int counter = nextTile.TotalPawnsInTile;
|
||||
for (int i = counter; i > 0; i--)
|
||||
{
|
||||
var pawn = nextTile.GetPlayerPawn();
|
||||
Debug.Log($"pawn: {pawn}");
|
||||
Debug.Log($"playerBase: {playerBaseHandler}");
|
||||
var playerBasePos = playerBaseHandler.GetPlayerBase(nextTile.PlayerPawn.PlayerType)
|
||||
.GetBasePlacementDataPosition(nextTile.PlayerPawn.PlayerId - 1);
|
||||
Debug.Log($"playerBasePos: {playerBasePos}");
|
||||
|
||||
var playerBasePos = playerBaseHandler.GetPlayerBase(pawn.PlayerType)
|
||||
.GetBasePlacementDataPosition(pawn.PlayerId - 1);
|
||||
Debug.Log($"playerBasePos: {playerBasePos}");
|
||||
|
||||
playerGameDatasDict[pawn.PlayerType].totalPawnsInHome++;
|
||||
pawn.MoveBackToHome(playerBasePos);
|
||||
}
|
||||
|
||||
CanRollDiceAgain = true;
|
||||
|
||||
if (playerPawn.IsBotPlayer)
|
||||
CheckDiceRollForBot(playerPawn);
|
||||
else
|
||||
SetCanRollDiceForUser(playerPawn.PlayerType, true);
|
||||
playerGameDatasDict[nextTile.PlayerPawn.PlayerType].totalPawnsInHome++;
|
||||
nextTile.PlayerPawn.MoveBackToHome(playerBasePos);
|
||||
}
|
||||
|
||||
nextTile.InitPlayerPawn(playerPawn, currentPlayerTypeTurn);
|
||||
}
|
||||
|
||||
SwitchPlayer(playerPawn);
|
||||
if (!CanRollDiceAgain)
|
||||
{
|
||||
SetCanRollDiceForUser(playerPawn.PlayerType, true);
|
||||
}
|
||||
CanRollDice = true;
|
||||
}
|
||||
},
|
||||
index);
|
||||
@ -851,16 +819,14 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
UpdatePlayerState(playerPawn, PlayerState.HasFinished);
|
||||
playerGameDatasDict[currentPlayerTypeTurn].totalPawnsFinished++;
|
||||
|
||||
Debug.Log($"totalPawnsFinished: {playerGameDatasDict[currentPlayerTypeTurn].totalPawnsFinished}, playerPawnsDict.Count: {playerGameDatasDict[currentPlayerTypeTurn].playerPawnsDict.Count}");
|
||||
if (playerGameDatasDict[currentPlayerTypeTurn].totalPawnsFinished == playerGameDatasDict[currentPlayerTypeTurn].playerPawnsDict.Count)
|
||||
{
|
||||
CanRollDiceAgain = false;
|
||||
|
||||
SwitchPlayer();
|
||||
if (allPlayerTypes.Contains(currentPlayerTypeTurn))
|
||||
allPlayerTypes.Remove(currentPlayerTypeTurn);
|
||||
|
||||
SwitchPlayer();
|
||||
|
||||
Debug.Log($"PlayerTypes: {allPlayerTypes.Count}");
|
||||
}
|
||||
else
|
||||
@ -875,16 +841,9 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
SwitchPlayer();
|
||||
}
|
||||
|
||||
SetCanRollDiceForUser(playerPawn.PlayerType, true);
|
||||
CanRollDice = true;
|
||||
}
|
||||
},
|
||||
index);
|
||||
}
|
||||
|
||||
private void SetCanRollDiceForUser(PlayerType playerType, bool state)
|
||||
{
|
||||
if (botTypesInGame.Contains(playerType)) return;
|
||||
|
||||
CanRollDice = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,7 +39,6 @@ public class PlayerBase : MonoBehaviour
|
||||
|
||||
public Transform GetBasePlacementDataPosition(int idx)
|
||||
{
|
||||
Debug.Log($"Index: {idx}, basePlacementDatas[idx]: {basePlacementDatas[idx]}");
|
||||
return basePlacementDatas[idx].placementTransform;
|
||||
}
|
||||
}
|
||||
|
||||
@ -27,30 +27,18 @@ public class Tile : MonoBehaviour
|
||||
|
||||
protected int lastOccupiedIndex = 0;
|
||||
|
||||
private List<PlayerPawn> PlayerPawns = new List<PlayerPawn>(); // Change implementation
|
||||
|
||||
public bool HasPawnsAvailable => PlayerPawns.Count > 0;
|
||||
public PlayerType CurrentHoldingPlayerType => PlayerPawns[0].PlayerType;
|
||||
public int TotalPawnsInTile => PlayerPawns.Count;
|
||||
|
||||
public PlayerPawn GetPlayerPawn()
|
||||
public PlayerPawn PlayerPawn // Change implementation
|
||||
{
|
||||
var pawn = PlayerPawns[0];
|
||||
PlayerPawns.RemoveAt(0);
|
||||
return pawn;
|
||||
get; private set;
|
||||
}
|
||||
|
||||
public virtual void InitPlayerPawn(PlayerPawn playerPawn, PlayerType playerType)
|
||||
{
|
||||
PlayerPawns.Add(playerPawn);
|
||||
Debug.Log($"Adding new PlayerPawn {playerPawn.name}, playerType: {playerType} to {name}");
|
||||
Debug.Log($"Adding new PlayerPawn {PlayerPawns.Count} {name}");
|
||||
PlayerPawn = playerPawn;
|
||||
}
|
||||
|
||||
public void ResetPlayerPawn(PlayerPawn movingPawn)
|
||||
public void ResetPlayerPawn()
|
||||
{
|
||||
PlayerPawns.Remove(movingPawn);
|
||||
Debug.Log($"Resetting new PlayerPawn {movingPawn.name} {name}");
|
||||
Debug.Log($"Resetting new PlayerPawn {PlayerPawns.Count} {name}");
|
||||
PlayerPawn = null;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user