first commit

This commit is contained in:
2026-06-04 21:37:43 +03:00
commit a6ea987b0d
152 changed files with 34059 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
using System.Collections.Generic;
using OTG.Lab06.Abilities;
using OTG.Lab06.Core;
using UnityEngine;
namespace OTG.Lab06.Effects
{
public sealed class IceNovaEffect : AbilityEffect
{
[SerializeField] private float visualLifetime = 1.2f;
[SerializeField] private LayerMask hitMask = ~0;
public override void Activate(AbilityCastContext context)
{
transform.position = context.Caster.position + Vector3.up * 0.05f;
float radius = Mathf.Max(0.1f, context.Ability.castRange);
Collider[] hits = Physics.OverlapSphere(context.Caster.position, radius, hitMask, QueryTriggerInteraction.Ignore);
var damaged = new HashSet<IDamageable>();
foreach (Collider hit in hits)
{
IDamageable damageable = hit.GetComponentInParent<IDamageable>();
if (damageable != null && damageable.IsAlive && damageable.Transform != context.Caster && damaged.Add(damageable))
{
damageable.TakeDamage(context.Ability.damage);
}
}
Destroy(gameObject, visualLifetime);
}
}
}