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