Beispiel #1
0
 /// <summary>
 ///     Will open a window if a check has to be made for the OnHitStatus to affect the target, then apply the status if required
 /// </summary>
 /// <param name="caster"> the one that tries to apply the status </param>
 /// <param name="target"> the target of the status </param>
 public static void CheckIfApply(this OnHitStatus onHitStatus, PlayableEntity caster, PlayableEntity target)
 {
     if (onHitStatus.HasApplyCondition)
     {
         OnHitStatusApplyWindow window = new OnHitStatusApplyWindow(caster, target);
         window.DataContext = onHitStatus;
         window.ShowCentered();
     }
     else
     {
         onHitStatus.Apply(caster, target);
     }
 }
Beispiel #2
0
        public static void Affected_TurnEnded(this OnHitStatus onHitStatus, object sender, TurnEndedEventArgs args)
        {
            bool expired = false;

            onHitStatus.CheckDotDamage(false, false);

            if (onHitStatus.HasAMaximumDuration && !onHitStatus.DurationIsCalculatedOnCasterTurn && !onHitStatus.DurationIsBasedOnStartOfTurn)
            {
                expired = onHitStatus.RemoveDuration();
            }
            if (!expired && onHitStatus.CanRedoSavingThrow && !onHitStatus.SavingIsRemadeAtStartOfTurn)
            {
                OnHitStatusApplyWindow window = new OnHitStatusApplyWindow(onHitStatus.Caster, onHitStatus.Affected, false);
                window.DataContext = onHitStatus;
                window.ShowCentered();
            }
        }