- Fixed #5100. Added a replacement effect for skipping the combat phase.

This commit is contained in:
jeffwadsworth 2018-11-23 11:36:29 -06:00
parent 43ee5e9c43
commit 2e17cb334e
7 changed files with 102 additions and 45 deletions

View file

@ -1,14 +1,14 @@
package mage.cards.b;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.effects.common.SkipNextCombatEffect;
import mage.abilities.effects.common.SkipCombatStepEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
/**
@ -18,7 +18,7 @@ import mage.constants.SubType;
public final class BlindingAngel extends CardImpl {
public BlindingAngel(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}{W}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}{W}");
this.subtype.add(SubType.ANGEL);
this.power = new MageInt(2);
@ -26,8 +26,10 @@ public final class BlindingAngel extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// Whenever Blinding Angel deals combat damage to a player, that player skips their next combat phase.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new SkipNextCombatEffect(), false, true));
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new SkipCombatStepEffect(Duration.OneUse).setText("that player skips their next combat phase."), false, true));
}
public BlindingAngel(final BlindingAngel card) {

View file

@ -1,11 +1,11 @@
package mage.cards.e;
import java.util.UUID;
import mage.abilities.effects.common.SkipNextCombatEffect;
import mage.abilities.effects.common.SkipCombatStepEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.target.common.TargetOpponent;
/**
@ -15,10 +15,10 @@ import mage.target.common.TargetOpponent;
public final class EmptyCityRuse extends CardImpl {
public EmptyCityRuse(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{W}");
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{W}");
// Target opponent skips all combat phases of their next turn.
this.getSpellAbility().addEffect(new SkipNextCombatEffect());
this.getSpellAbility().addEffect(new SkipCombatStepEffect(Duration.UntilYourNextTurn).setText("Target opponent skips all combat phases of their next turn."));
this.getSpellAbility().addTarget(new TargetOpponent());
}

View file

@ -1,11 +1,11 @@
package mage.cards.f;
import java.util.UUID;
import mage.abilities.effects.common.SkipNextCombatEffect;
import mage.abilities.effects.common.SkipCombatStepEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.target.TargetPlayer;
/**
@ -15,10 +15,10 @@ import mage.target.TargetPlayer;
public final class FalsePeace extends CardImpl {
public FalsePeace(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{W}");
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{W}");
// Target player skips all combat phases of their next turn.
this.getSpellAbility().addEffect(new SkipNextCombatEffect());
this.getSpellAbility().addEffect(new SkipCombatStepEffect(Duration.UntilYourNextTurn).setText("Target player skips all combat phases of their next turn."));
this.getSpellAbility().addTarget(new TargetPlayer());
}

View file

@ -1,11 +1,11 @@
package mage.cards.m;
import java.util.UUID;
import mage.abilities.effects.common.SkipNextCombatEffect;
import mage.abilities.effects.common.SkipCombatStepEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.target.TargetPlayer;
/**
@ -15,10 +15,10 @@ import mage.target.TargetPlayer;
public final class MomentOfSilence extends CardImpl {
public MomentOfSilence(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{W}");
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{W}");
// Target player skips their next combat phase this turn.
this.getSpellAbility().addEffect(new SkipNextCombatEffect());
this.getSpellAbility().addEffect(new SkipCombatStepEffect(Duration.EndOfTurn).setText("Target player skips their next combat this turn"));
this.getSpellAbility().addTarget(new TargetPlayer());
}

View file

@ -1,4 +1,3 @@
package mage.cards.r;
import java.util.UUID;
@ -8,12 +7,13 @@ import mage.abilities.common.CantBlockAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.common.ManaWasSpentCondition;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.SkipNextCombatEffect;
import mage.abilities.effects.common.SkipCombatStepEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.ColoredManaSymbol;
import mage.constants.Duration;
import mage.target.TargetPlayer;
import mage.watchers.common.ManaSpentToCastWatcher;
@ -24,13 +24,13 @@ import mage.watchers.common.ManaSpentToCastWatcher;
public final class RevenantPatriarch extends CardImpl {
public RevenantPatriarch(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{B}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}");
this.subtype.add(SubType.SPIRIT);
this.power = new MageInt(4);
this.toughness = new MageInt(3);
// When Revenant Patriarch enters the battlefield, if {W} was spent to cast it, target player skips their next combat phase.
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new SkipNextCombatEffect(), false);
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new SkipCombatStepEffect(Duration.OneUse).setText("target player skips their next combat phase."), false);
ability.addTarget(new TargetPlayer());
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new ManaWasSpentCondition(ColoredManaSymbol.W),
"if {W} was spent to cast it, target player skips their next combat phase."), new ManaSpentToCastWatcher());

View file

@ -1,14 +1,14 @@
package mage.cards.s;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.SkipNextCombatEffect;
import mage.abilities.effects.common.SkipCombatStepEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.target.common.TargetOpponent;
@ -19,7 +19,7 @@ import mage.target.common.TargetOpponent;
public final class StonehornDignitary extends CardImpl {
public StonehornDignitary(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}");
this.subtype.add(SubType.RHINO);
this.subtype.add(SubType.SOLDIER);
@ -27,7 +27,7 @@ public final class StonehornDignitary extends CardImpl {
this.toughness = new MageInt(4);
// When Stonehorn Dignitary enters the battlefield, target opponent skips their next combat phase.
Ability ability = new EntersBattlefieldTriggeredAbility(new SkipNextCombatEffect());
Ability ability = new EntersBattlefieldTriggeredAbility(new SkipCombatStepEffect(Duration.OneUse).setText("target opponent skips their next combat phase."));
ability.addTarget(new TargetOpponent());
this.addAbility(ability);
}

View file

@ -0,0 +1,55 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mage.abilities.effects.common;
import mage.abilities.Ability;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.game.Game;
import mage.game.events.GameEvent;
/**
*
* @author jeffwadsworth
*/
public class SkipCombatStepEffect extends ReplacementEffectImpl {
public SkipCombatStepEffect(Duration duration) {
super(duration, Outcome.Detriment);
staticText = "that player skips their next combat phase";
}
public SkipCombatStepEffect(final SkipCombatStepEffect effect) {
super(effect);
}
@Override
public SkipCombatStepEffect copy() {
return new SkipCombatStepEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
return true;
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
return true;
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.COMBAT_PHASE;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
return event.getPlayerId().equals(targetPointer.getFirst(game, source));
}
}