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;
}

View file

@ -0,0 +1,10 @@
using UnityEngine;
[CreateAssetMenu(fileName = "New Enemy Melee Ability", menuName = "EnemyAbilities/Melee")]
public class EnemyMelee : EnemyAbility
{
public override void UseAbility(Entity target, Enemy owner)
{
target.TakeDamage(power, owner);
}
}

View file

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 5766cdfd69614633494a3b73de96271a