public void Attack(Actor actor) { if (OnCooldown) { return; } if (_teamable != null && actor.TryGetModule <ITeamable>(out var teamable)) { if (_teamable.IsAlly(teamable)) { return; } } PerformAttack(actor, GetAttackDamage(), true); }
/// <summary> /// Check if other and teamable are both allies. /// </summary> /// <param name="teamable">This teamable.</param> /// <param name="other">The other teamable.</param> /// <returns>True if both other and teamable are allies.</returns> public static bool IsAllySymetric(this ITeamable teamable, ITeamable other) => teamable.IsAlly(other) && teamable.IsRelationSymetric(other);