mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
[SNC] Implemented Sizzling Soloist
This commit is contained in:
parent
69ecaf97fd
commit
33a3aab75f
3 changed files with 102 additions and 3 deletions
90
Mage.Sets/src/mage/cards/s/SizzlingSoloist.java
Normal file
90
Mage.Sets/src/mage/cards/s/SizzlingSoloist.java
Normal file
|
@ -0,0 +1,90 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AllianceAbility;
|
||||
import mage.abilities.effects.RequirementEffect;
|
||||
import mage.abilities.effects.common.IfAbilityHasResolvedXTimesEffect;
|
||||
import mage.abilities.effects.common.combat.CantBlockTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetOpponentsCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class SizzlingSoloist extends CardImpl {
|
||||
|
||||
public SizzlingSoloist(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}");
|
||||
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.CITIZEN);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// Alliance — Whenever another creature enters the battlefield under your control, target creature an opponent controls can't block this turn. If this is the second time this ability has resolved this turn, that creature attacks during its controller's next combat phase if able.
|
||||
Ability ability = new AllianceAbility(new CantBlockTargetEffect(Duration.EndOfTurn));
|
||||
ability.addEffect(new IfAbilityHasResolvedXTimesEffect(
|
||||
Outcome.Benefit, 2, new SizzlingSoloistEffect()
|
||||
));
|
||||
ability.addTarget(new TargetOpponentsCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private SizzlingSoloist(final SizzlingSoloist card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SizzlingSoloist copy() {
|
||||
return new SizzlingSoloist(this);
|
||||
}
|
||||
}
|
||||
|
||||
class SizzlingSoloistEffect extends RequirementEffect {
|
||||
|
||||
public SizzlingSoloistEffect() {
|
||||
super(Duration.Custom);
|
||||
staticText = "that creature attacks during its controller's next combat phase if able";
|
||||
}
|
||||
|
||||
public SizzlingSoloistEffect(final SizzlingSoloistEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SizzlingSoloistEffect copy() {
|
||||
return new SizzlingSoloistEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||
return getTargetPointer().getFirst(game, source).equals(permanent.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInactive(Ability source, Game game) {
|
||||
if (game.getPermanent(getTargetPointer().getFirst(game, source)) == null) {
|
||||
return true;
|
||||
}
|
||||
return game.isActivePlayer(game.getControllerId(getTargetPointer().getFirst(game, source)))
|
||||
&& game.getPhase().getType() == TurnPhase.COMBAT
|
||||
&& game.getStep().getType() == PhaseStep.END_COMBAT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mustAttack(Game game) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mustBlock(Game game) {
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -214,6 +214,7 @@ public final class StreetsOfNewCapenna extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Sewer Crocodile", 60, Rarity.COMMON, mage.cards.s.SewerCrocodile.class));
|
||||
cards.add(new SetCardInfo("Shadow of Mortality", 94, Rarity.RARE, mage.cards.s.ShadowOfMortality.class));
|
||||
cards.add(new SetCardInfo("Shakedown Heavy", 95, Rarity.RARE, mage.cards.s.ShakedownHeavy.class));
|
||||
cards.add(new SetCardInfo("Sizzling Soloist", 123, Rarity.UNCOMMON, mage.cards.s.SizzlingSoloist.class));
|
||||
cards.add(new SetCardInfo("Sky Crier", 31, Rarity.COMMON, mage.cards.s.SkyCrier.class));
|
||||
cards.add(new SetCardInfo("Skybridge Towers", 256, Rarity.COMMON, mage.cards.s.SkybridgeTowers.class));
|
||||
cards.add(new SetCardInfo("Sleep with the Fishes", 61, Rarity.UNCOMMON, mage.cards.s.SleepWithTheFishes.class));
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue