Pedro Gomes 59c74b1d31 New abilities, bugfix necro autosummon, updated effects
- Knight Challenging Shout AoE Taunt ability
- Mage Firewall AoE Burn ability
- Added support for movement speed modifier effects to slow enemies instead of only buffing allies.
- Added different movement speed minimum cap to enemies and bosses
2024-12-21 20:40:31 +00:00

35 lines
1.0 KiB
C#

using Kryz.CharacterStats;
using Kryz.CharacterStats.Examples;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(fileName = "TauntEffect", menuName = "RiftMayhem/AbilitySystem/Effects/Taunt Effect", order = 1)]
public class TauntEffect : BaseEffect
{
BasicEnemyNPCController enemyNPCController;
public override void ApplyEffect(Taggable user, List<Taggable> targets)
{
foreach (Taggable target in targets)
{
if (!IsEnemy(user, target)) continue;
enemyNPCController = target.GetComponent<BasicEnemyNPCController>();
if (enemyNPCController is MinionNPCController) continue; //redundant but never too sure
enemyNPCController.currentTarget = user;
}
}
private bool IsEnemy(Taggable user, Taggable target)
{
if (user == null) return false;
if (target == null) return false;
return user.AlliedTagsContains(target.targetTag) ? false : true;
}
}