mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 12:31:59 -08:00
[WHO] Implement Amy Pond and Rory Williams (#11929)
* [WHO] Implement Amy Pond * [WHO] Implement Rory Williams * Modified ExileSpellWithTimeCountersEffect to include the ability to give the card suspend, simplified Epochrasite * adjustments --------- Co-authored-by: xenohedron <xenohedron@users.noreply.github.com>
This commit is contained in:
parent
286dc5f142
commit
8f6b3e0faf
6 changed files with 234 additions and 54 deletions
|
|
@ -1,7 +1,9 @@
|
|||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.MageObjectReference;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continuous.GainSuspendEffect;
|
||||
import mage.abilities.keyword.SuspendAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.Outcome;
|
||||
|
|
@ -18,16 +20,23 @@ import java.util.UUID;
|
|||
public class ExileSpellWithTimeCountersEffect extends OneShotEffect {
|
||||
|
||||
private final int counters;
|
||||
private final boolean gainsSuspend;
|
||||
|
||||
public ExileSpellWithTimeCountersEffect(int counters) {
|
||||
super(Outcome.Exile);
|
||||
this.counters = counters;
|
||||
this.staticText = "Exile {this} with " + CardUtil.numberToText(this.counters) + " time counters on it";
|
||||
this (counters, false);
|
||||
}
|
||||
|
||||
public ExileSpellWithTimeCountersEffect(int counters, boolean gainsSuspend) {
|
||||
super(Outcome.Exile);
|
||||
this.counters = counters;
|
||||
this.gainsSuspend = gainsSuspend;
|
||||
this.staticText = "exile {this} with " + CardUtil.numberToText(this.counters) + " time counters on it"
|
||||
+ (gainsSuspend ? ". It gains suspend" : "");
|
||||
}
|
||||
private ExileSpellWithTimeCountersEffect(final ExileSpellWithTimeCountersEffect effect) {
|
||||
super(effect);
|
||||
this.counters = effect.counters;
|
||||
this.gainsSuspend = effect.gainsSuspend;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -38,14 +47,17 @@ public class ExileSpellWithTimeCountersEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Card card = game.getStack().getSpell(source.getId()).getCard();
|
||||
Card card = game.getCard(source.getSourceId());
|
||||
if (controller == null || card == null) {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
UUID exileId = SuspendAbility.getSuspendExileId(controller.getId(), game);
|
||||
if (!card.isCopy() && controller.moveCardsToExile(card, source, game, true, exileId, "Suspended cards of " + controller.getName())) {
|
||||
card.addCounters(CounterType.TIME.createInstance(3), source.getControllerId(), source, game);
|
||||
game.informPlayers(controller.getLogName() + " exiles " + card.getLogName() + " with " + counters + " time counters on it");
|
||||
if (gainsSuspend) {
|
||||
game.addEffect(new GainSuspendEffect(new MageObjectReference(card, game)), source);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
package mage.filter.common;
|
||||
|
||||
import mage.abilities.keyword.SuspendAbility;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.mageobject.AbilityPredicate;
|
||||
|
||||
/**
|
||||
* @author skiwkr
|
||||
* 702.62b. A card is "suspended" if it's in the exile zone, has suspend, and has a time counter on it.
|
||||
*/
|
||||
public class FilterSuspendedCard extends FilterCard {
|
||||
|
||||
public FilterSuspendedCard() {
|
||||
this("suspended card");
|
||||
}
|
||||
|
||||
public FilterSuspendedCard(String name) {
|
||||
super(name);
|
||||
this.add(new AbilityPredicate(SuspendAbility.class));
|
||||
this.add(CounterType.TIME.getPredicate());
|
||||
}
|
||||
|
||||
protected FilterSuspendedCard(final FilterSuspendedCard filter) {
|
||||
super(filter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FilterSuspendedCard copy() {
|
||||
return new FilterSuspendedCard(this);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue