[SNC] Implemented Sizzling Soloist

This commit is contained in:
Evan Kranzler 2022-04-17 20:42:47 -04:00
parent 69ecaf97fd
commit 33a3aab75f
3 changed files with 102 additions and 3 deletions

View file

@ -1,6 +1,7 @@
package mage.abilities.effects.common;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
@ -21,8 +22,6 @@ public class IfAbilityHasResolvedXTimesEffect extends OneShotEffect {
super(outcome);
this.resolutionNumber = resolutionNumber;
this.effect = effect;
this.staticText = "If this is the " + CardUtil.numberToOrdinalText(resolutionNumber) + " time this ability has resolved this turn, " +
effect.getText(null);
}
private IfAbilityHasResolvedXTimesEffect(final IfAbilityHasResolvedXTimesEffect effect) {
@ -39,7 +38,7 @@ public class IfAbilityHasResolvedXTimesEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
if (AbilityResolvedWatcher.getResolutionCount(game, source) != resolutionNumber) {
return true;
return false;
}
if (effect instanceof OneShotEffect) {
return effect.apply(game, source);
@ -47,4 +46,13 @@ public class IfAbilityHasResolvedXTimesEffect extends OneShotEffect {
game.addEffect((ContinuousEffect) effect, source);
return true;
}
@Override
public String getText(Mode mode) {
if (staticText != null && !staticText.isEmpty()) {
return staticText;
}
return "If this is the " + CardUtil.numberToOrdinalText(resolutionNumber) +
" time this ability has resolved this turn, " + effect.getText(mode);
}
}