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

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

Loading…
Cancel
Save