public void UseItemOn(Item item, Character character) { this.CheckAlive(); character.CheckAlive(); item.AffectCharacter(character); }
public void GiveCharacterItem(Item item, Character character) { this.CheckAlive(); character.CheckAlive(); character.ReceiveItem(item); }
public void Heal(Character character) { this.CheckAlive(); character.CheckAlive(); if (this.Faction != character.Faction) { throw new InvalidOperationException("Cannot heal enemy character!"); } character.IncreaseHealth(this.AbilityPoints); }
public void Attack(Character character) { this.CheckAlive(); character.CheckAlive(); if (this == character) { throw new InvalidOperationException("Cannot attack self!"); } if (this.Faction == character.Faction) { throw new ArgumentException($"Friendly fire! Both characters are from {this.Faction.ToString()} faction!"); } character.TakeDamage(this.AbilityPoints); }