public override void Use(Entity target) { var message = $"{AbilityOwner.Name} farts on {target.Name}!"; var eventMediator = Object.FindObjectOfType <EventMediator>(); eventMediator.Broadcast(GlobalHelper.SendMessageToConsole, this, message); eventMediator.SubscribeToEvent(GlobalHelper.TargetHit, this); AbilityOwner.AttackWithAbility(target, this); AbilityOwner.SubtractActionPoints(ApCost); eventMediator.UnsubscribeFromEvent(GlobalHelper.TargetHit, this); }
public override void Use(Entity target) { var message = $"{AbilityOwner.Name} attacks {target.Name} with {GlobalHelper.CapitalizeAllWords(Name)}!"; var eventMediator = Object.FindObjectOfType <EventMediator>(); eventMediator.Broadcast(GlobalHelper.SendMessageToConsole, this, message); eventMediator.SubscribeToEvent(GlobalHelper.DamageDealt, this); AbilityOwner.AttackWithAbility(target, this); AbilityOwner.SubtractActionPoints(ApCost); eventMediator.UnsubscribeFromEvent(GlobalHelper.DamageDealt, this); }
public virtual void Use(Entity target) { //todo testing for prototype - assumes combat ability //todo message assumes combat ability var message = $"{AbilityOwner.Name} attacks {target.Name} with {GlobalHelper.CapitalizeAllWords(Name)}!"; var eventMediator = Object.FindObjectOfType <EventMediator>(); eventMediator.Broadcast(GlobalHelper.SendMessageToConsole, this, message); if (Range < 2) { AbilityOwner.AttackWithAbility(target, this); } else { AbilityOwner.RangedAttack(target); } AbilityOwner.SubtractActionPoints(ApCost); }