private IResult PerformSuccess(IMobileObject performer, IMobileObject targetMob) { Parameter.PerformerMessage = PerformerNotificationSuccess; Parameter.TargetMessage = TargetNotificationSuccess; Parameter.RoomMessage = RoomNotificationSuccess; Effect.ProcessEffect(Parameter); List <IMobileObject> exclusions = new List <IMobileObject>() { performer }; if (targetMob != null && !exclusions.Contains(targetMob)) { exclusions.Add(targetMob); } if (RoomNotificationSuccess != null) { GlobalReference.GlobalValues.Notify.Room(performer, targetMob, performer.Room, RoomNotificationSuccess, exclusions); } AdditionalEffect(performer, targetMob); string message = GlobalReference.GlobalValues.StringManipulator.UpdateTargetPerformer(performer.SentenceDescription, targetMob?.SentenceDescription, PerformerNotificationSuccess.GetTranslatedMessage(performer)); return(new Result(message, false, null)); }
public virtual IResult ProcessSpell(IMobileObject performer, ICommand command) { if (performer.Mana >= ManaCost) { performer.Mana -= ManaCost; Effect.ProcessEffect(Parameter); IMobileObject targetMob = Parameter.Target as IMobileObject; List <IMobileObject> exclusions = new List <IMobileObject>() { performer }; if (targetMob != null && !exclusions.Contains(targetMob)) { exclusions.Add(targetMob); } if (RoomNotificationSuccess != null) { GlobalReference.GlobalValues.Notify.Room(performer, Parameter.Target, performer.Room, RoomNotificationSuccess, exclusions); } if (TargetNotificationSuccess != null) { if (targetMob != null) { GlobalReference.GlobalValues.Notify.Mob(performer, targetMob, targetMob, TargetNotificationSuccess); } } string message = GlobalReference.GlobalValues.StringManipulator.UpdateTargetPerformer(performer.SentenceDescription, targetMob?.SentenceDescription, PerformerNotificationSuccess.GetTranslatedMessage(performer)); return(new Result(message, false, null)); } else { return(new Result($"You need {ManaCost} mana to cast the spell {command.Parameters[0].ParameterValue}.", true)); } }