Set ability locks for player catogories

dev-hazim
Hazim Bin Ijaz 4 days ago
parent 13952f3021
commit b79bb91869

@ -87,6 +87,7 @@ public class CrowManager : NetworkBehaviour
if (currentCrow != null)
{
currentCrow.Movement.SetSpeedModifier(1f);
currentCrow.SetAsCrow(false); // Clear old crow
}
@ -94,6 +95,7 @@ public class CrowManager : NetworkBehaviour
currentCrow.SetAsCrow(true);
Debug.Log($"{currentCrow.name} is now the Crow.");
currentCrow.Movement.SetSpeedModifier(1.5f);
// Notify all clients about the new crow
NotifyCrowChangeClientRpc(currentCrow.OwnerClientId);
}

@ -533,14 +533,29 @@ namespace Unity.BossRoom.Gameplay.UserInput
if (Input.GetKeyDown(KeyCode.E)) // Dash'N'Crash
{
if (!m_ServerCharacter.IsCrow)
{
m_UIMessageFeed.DisplayMessage("You must be the Crow to activate this ability");
return;
}
ActivateAbilityIfAllowed(GameDataSource.Instance.DashNCrashAbilityKey, "Abilities are only for crow");
}
if (Input.GetKeyDown(KeyCode.R)) // Freeze Throw
{
if (m_ServerCharacter.IsCrow)
{
m_UIMessageFeed.DisplayMessage("Ability not available for crow");
return;
}
ActivateAbilityIfAllowed(GameDataSource.Instance.FreezeThrowAbilityKey);
}
if (Input.GetKeyDown(KeyCode.F)) // Vector Wall
{
if (m_ServerCharacter.IsCrow)
{
m_UIMessageFeed.DisplayMessage("Ability not available for crow");
return;
}
ActivateAbilityIfAllowed(GameDataSource.Instance.VectorWallAbilityKey);
}
}
@ -596,19 +611,19 @@ namespace Unity.BossRoom.Gameplay.UserInput
return;
}
if (abilityKey == GameDataSource.Instance.DashNCrashAbilityKey && !m_ServerCharacter.IsCrow)
{
if (errorMessage != null)
{
m_UIMessageFeed.DisplayMessage(errorMessage);
}
Debug.Log("You must be the Crow to activate this ability.");
return;
}
else
{
Debug.Log("abilitykey: " + abilityKey);
}
// if (abilityKey == GameDataSource.Instance.DashNCrashAbilityKey && !m_ServerCharacter.IsCrow)
// {
// if (errorMessage != null)
// {
// m_UIMessageFeed.DisplayMessage(errorMessage);
// }
// Debug.Log("You must be the Crow to activate this ability.");
// return;
// }
// else
// {
// Debug.Log("abilitykey: " + abilityKey);
// }
m_UIMessageFeed.DisplayMessage("Activated Ability mode");
m_AbilitySystem.ActivateAbilityByKey(abilityKey);

Loading…
Cancel
Save