the worlds WORST code

This commit is contained in:
Sylvia 2026-03-21 23:16:44 -07:00
parent 99cda5f6b9
commit c2a71d5188
6 changed files with 731 additions and 8 deletions

View file

@ -53,7 +53,7 @@ public class Enemy : Entity
Ability foundAbility = null;
foreach (Ability availableAbility in allAbilities)
{
if (foundAbility == null && availableAbility.currentCooldown <= 0)
if (foundAbility == null && availableAbility.currentCooldown <= 0 && availableAbility.ability.range < Vector3.Distance(closestTarget.transform.position, transform.position))
{
foundAbility = availableAbility;
}