public void Heal(float healthPoints, Character healer, Character target) { FactionService factionService = new FactionService(); if (!factionService.IsAllies(healer, target)) { return; } target.SetRegeneration(healthPoints); }
public void Attack(float damagePoints, Character attacker, ILivingThing target) { PositionService positionService = new PositionService(); FactionService factionService = new FactionService(); if (target is Character enemy) { if (attacker.Equals(target) || !positionService.IsInRange(attacker, enemy) || factionService.IsAllies(attacker, enemy)) { return; } damagePoints *= CalculateThreshold(attacker, enemy); } target.SetDamage(damagePoints); }