more abilities and fixes

This commit is contained in:
Sylvia 2026-06-12 03:54:49 -07:00
parent cb4470f2d6
commit fc2329a873
31 changed files with 268 additions and 52 deletions

View file

@ -0,0 +1,24 @@
using UnityEngine;
public class SwordSlash : Ability
{
public LayerMask entityLayer;
//probably will change out entity detection. or will i?
//i'd also probably have to offset the damage origin direction
public float damageRadius;
protected override void AbilityEffects()
{
base.AbilityEffects();
Collider2D[] entitiesFound = Physics2D.OverlapCircleAll(thisEntity.stats.attackOriginPoint.position, damageRadius, entityLayer);
foreach (Collider2D entityFound in entitiesFound)
{
if (!entityFound.CompareTag(thisEntity.tag))
{
if (entityFound.TryGetComponent(out Entity isEntity))
{
isEntity.stats.TakeDamage(power);
}
}
}
}
}