|
|
|
@ -61,7 +61,7 @@ public class AbilitySystem : NetworkBehaviour
|
|
|
|
|
UpdateWallIndicatorPosition(); // Follow the mouse when ability is activated
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Input.GetMouseButtonDown(0))//AliSharoz && isValidPlacement)
|
|
|
|
|
if (Input.GetMouseButtonDown(0))
|
|
|
|
|
{
|
|
|
|
|
StartWallPlacement();
|
|
|
|
|
}
|
|
|
|
@ -93,6 +93,11 @@ public class AbilitySystem : NetworkBehaviour
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void IsInRadius()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ManageVectorFenceIndicator()
|
|
|
|
|
{
|
|
|
|
|
if (wallIndicator != null)
|
|
|
|
@ -242,6 +247,15 @@ public class AbilitySystem : NetworkBehaviour
|
|
|
|
|
Debug.Log("Ability mode deactivated.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private bool IsPlacementWithinRadius(Vector3 targetPosition)
|
|
|
|
|
{
|
|
|
|
|
float placementRadius = activeAbility.abilityApplicationRadius; // Fetch radius from the active ability
|
|
|
|
|
float distance = Vector3.Distance(transform.position, targetPosition);
|
|
|
|
|
|
|
|
|
|
return distance <= placementRadius;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void UseActiveAbility()
|
|
|
|
|
{
|
|
|
|
|
if (activeAbility == null)
|
|
|
|
@ -250,9 +264,15 @@ public class AbilitySystem : NetworkBehaviour
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Vector3 targetPosition = activeAbility.abilityKey == "VectorFence" ? wallIndicator.transform.position : currentAbilityIndicator.transform.position;
|
|
|
|
|
Vector3 targetRotation = activeAbility.abilityKey == "VectorFence" ? wallIndicator.transform.eulerAngles : currentAbilityIndicator.transform.eulerAngles;
|
|
|
|
|
GameObject indicator = activeAbility.abilityKey == "VectorFence" ? wallIndicator : currentAbilityIndicator;
|
|
|
|
|
Vector3 targetPosition = indicator.transform.position;
|
|
|
|
|
Vector3 targetRotation = indicator.transform.eulerAngles;
|
|
|
|
|
|
|
|
|
|
if (!IsPlacementWithinRadius(targetPosition))
|
|
|
|
|
{
|
|
|
|
|
Debug.Log("[AbilitySystem] Not in Radius.");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
Debug.Log($"[AbilitySystem] Using active ability {activeAbility.abilityName}.");
|
|
|
|
|
RequestAbilityActivationServerRpc(activeAbility.abilityKey, targetPosition, targetRotation);
|
|
|
|
|
StartCoroutine(StartCooldown(activeAbility));
|
|
|
|
|