mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
updated Flagbearer ability to reflect rules change
This commit is contained in:
parent
1431e69b43
commit
9b94b27e54
4 changed files with 32 additions and 27 deletions
|
@ -1,8 +1,6 @@
|
|||
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
|
@ -11,18 +9,13 @@ import mage.abilities.effects.common.ruleModifying.TargetsHaveToTargetPermanentI
|
|||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.AttachmentType;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.constants.*;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public final class CoalitionFlag extends CardImpl {
|
||||
|
@ -40,10 +33,12 @@ public final class CoalitionFlag extends CardImpl {
|
|||
this.addAbility(ability);
|
||||
|
||||
// Enchanted creature is a Flagbearer.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetCardSubtypeAttachedEffect(Duration.WhileOnBattlefield, AttachmentType.AURA, SubType.FLAGBEARER)));
|
||||
this.addAbility(new SimpleStaticAbility(new SetCardSubtypeAttachedEffect(
|
||||
Duration.WhileOnBattlefield, AttachmentType.AURA, SubType.FLAGBEARER
|
||||
)));
|
||||
|
||||
// While choosing targets as part of casting a spell or activating an ability, your opponents must choose at least one Flagbearer on the battlefield if able.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new TargetsHaveToTargetPermanentIfAbleEffect(new FilterPermanent(SubType.FLAGBEARER, "one Flagbearer"))));
|
||||
this.addAbility(new SimpleStaticAbility(new TargetsHaveToTargetPermanentIfAbleEffect()));
|
||||
}
|
||||
|
||||
public CoalitionFlag(final CoalitionFlag card) {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.ruleModifying.TargetsHaveToTargetPermanentIfAbleEffect;
|
||||
|
@ -9,8 +8,8 @@ import mage.cards.CardImpl;
|
|||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Cardname: Coalition Honor Guard
|
||||
|
@ -28,7 +27,7 @@ public final class CoalitionHonorGuard extends CardImpl {
|
|||
this.toughness = new MageInt(4);
|
||||
|
||||
// While choosing targets as part of casting a spell or activating an ability, your opponents must choose at least one Flagbearer on the battlefield if able.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new TargetsHaveToTargetPermanentIfAbleEffect(new FilterPermanent(SubType.FLAGBEARER, "one Flagbearer"))));
|
||||
this.addAbility(new SimpleStaticAbility(new TargetsHaveToTargetPermanentIfAbleEffect()));
|
||||
}
|
||||
|
||||
public CoalitionHonorGuard(final CoalitionHonorGuard card) {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.ruleModifying.TargetsHaveToTargetPermanentIfAbleEffect;
|
||||
|
@ -9,11 +8,10 @@ import mage.cards.CardImpl;
|
|||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public final class StandardBearer extends CardImpl {
|
||||
|
@ -27,7 +25,7 @@ public final class StandardBearer extends CardImpl {
|
|||
this.toughness = new MageInt(1);
|
||||
|
||||
// While choosing targets as part of casting a spell or activating an ability, your opponents must choose at least one Flagbearer on the battlefield if able.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new TargetsHaveToTargetPermanentIfAbleEffect(new FilterPermanent(SubType.FLAGBEARER, "one Flagbearer"))));
|
||||
this.addAbility(new SimpleStaticAbility(new TargetsHaveToTargetPermanentIfAbleEffect()));
|
||||
}
|
||||
|
||||
public StandardBearer(final StandardBearer card) {
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
*/
|
||||
package mage.abilities.effects.common.ruleModifying;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.ActivatedAbility;
|
||||
|
@ -14,6 +12,7 @@ import mage.abilities.SpellAbility;
|
|||
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
@ -22,11 +21,14 @@ import mage.game.stack.StackObject;
|
|||
import mage.players.Player;
|
||||
import mage.target.Target;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* 6/8/2016 If a spell or ability's targets are changed, or if a copy of a spell
|
||||
* or ability is put onto the stack and has new targets chosen, it doesn't have
|
||||
* to target a Flagbearer.
|
||||
*
|
||||
* <p>
|
||||
* 3/16/2017 A Flagbearer only requires targeting of itself when choosing targets
|
||||
* as a result of casting a spell or activating an ability. Notably, triggered
|
||||
* abilities are exempt from this targeting restriction (in addition to the note
|
||||
|
@ -37,15 +39,22 @@ import mage.target.Target;
|
|||
public class TargetsHaveToTargetPermanentIfAbleEffect extends ContinuousRuleModifyingEffectImpl {
|
||||
|
||||
private final FilterPermanent filter;
|
||||
private static final FilterPermanent flagbearerFilter = new FilterPermanent(SubType.FLAGBEARER, "one Flagbearer");
|
||||
|
||||
public TargetsHaveToTargetPermanentIfAbleEffect() {
|
||||
this(flagbearerFilter);
|
||||
}
|
||||
|
||||
public TargetsHaveToTargetPermanentIfAbleEffect(FilterPermanent filter) {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Detriment);
|
||||
this.filter = filter;
|
||||
staticText = "While choosing targets as part of casting a spell or activating an ability, your opponents must choose at least " + this.filter.getMessage() + " on the battlefield if able";
|
||||
staticText = "While an opponent is choosing targets as part of casting a spell they control " +
|
||||
"or activating an ability they control, that player must choose at least " +
|
||||
this.filter.getMessage() + " on the battlefield if able";
|
||||
|
||||
}
|
||||
|
||||
public TargetsHaveToTargetPermanentIfAbleEffect(final TargetsHaveToTargetPermanentIfAbleEffect effect) {
|
||||
private TargetsHaveToTargetPermanentIfAbleEffect(final TargetsHaveToTargetPermanentIfAbleEffect effect) {
|
||||
super(effect);
|
||||
this.filter = effect.filter;
|
||||
}
|
||||
|
@ -86,6 +95,10 @@ public class TargetsHaveToTargetPermanentIfAbleEffect extends ContinuousRuleModi
|
|||
!(stackAbility instanceof SpellAbility)) {
|
||||
return false;
|
||||
}
|
||||
// Also check that targeting player controls the ability
|
||||
if (!stackAbility.isControlledBy(targetingPlayer.getId())) {
|
||||
return false;
|
||||
}
|
||||
Ability ability = (Ability) getValue("targetAbility");
|
||||
if (ability != null) {
|
||||
// Get all the allowed permanents on the battlefield in range of the abilities controller
|
||||
|
|
Loading…
Reference in a new issue