public static void Caster_PropertyChanged(this OnHitStatus onHitStatus, object sender, PropertyChangedEventArgs e) { if (onHitStatus.EndsOnCasterLossOfConcentration && e.PropertyName == "IsFocused" && onHitStatus.Caster.IsFocused == false) { console.AddEntry("Due to "); console.AddEntry($"{onHitStatus.Caster.DisplayName}", fontWeightProvider.SemiBold); console.AddEntry("'s loss of concentration, "); onHitStatus.RemoveStatus(); } }
/// <summary> /// removes 1 turn from the Remaining rounds variable /// if the status expires, the function removes it from the target of the status /// </summary> /// <returns></returns> private static bool RemoveDuration(this OnHitStatus onHitStatus) { onHitStatus.RemainingRounds -= 1; if (onHitStatus.RemainingRounds <= 0) { console.AddEntry("The Status inflicted by "); console.AddEntry($"{onHitStatus.Caster.DisplayName}", fontWeightProvider.SemiBold); console.AddEntry(" has expired. "); onHitStatus.RemoveStatus(); // if caster was focused on this, he can now be "un"focused if (onHitStatus.EndsOnCasterLossOfConcentration && onHitStatus.Caster.IsFocused && onHitStatus.Caster == onHitStatus.Affected) { onHitStatus.Caster.IsFocused = false; } return(true); } return(false); }