mirror of
https://github.com/correl/mage.git
synced 2025-01-11 19:13:02 +00:00
* Rally the Ancestors - Fixed that the delayed exile effect still did move the card if it left the battlefield meanwhile.
This commit is contained in:
parent
fcd74a65a9
commit
fd08db3b2b
2 changed files with 17 additions and 16 deletions
|
@ -34,8 +34,8 @@ import mage.abilities.DelayedTriggeredAbility;
|
||||||
import mage.abilities.common.delayed.AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility;
|
import mage.abilities.common.delayed.AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility;
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.ExileTargetEffect;
|
|
||||||
import mage.abilities.effects.common.ExileSpellEffect;
|
import mage.abilities.effects.common.ExileSpellEffect;
|
||||||
|
import mage.abilities.effects.common.ExileTargetEffect;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
|
@ -76,21 +76,21 @@ public class RallyTheAncestors extends CardImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
class RallyTheAncestorsEffect extends OneShotEffect {
|
class RallyTheAncestorsEffect extends OneShotEffect {
|
||||||
|
|
||||||
RallyTheAncestorsEffect() {
|
RallyTheAncestorsEffect() {
|
||||||
super(Outcome.PutCreatureInPlay);
|
super(Outcome.PutCreatureInPlay);
|
||||||
this.staticText = "Return each creature card with converted mana cost X or less from your graveyard to the battlefield. Exile those creatures at the beginning of your next upkeep";
|
this.staticText = "Return each creature card with converted mana cost X or less from your graveyard to the battlefield. Exile those creatures at the beginning of your next upkeep";
|
||||||
}
|
}
|
||||||
|
|
||||||
RallyTheAncestorsEffect(final RallyTheAncestorsEffect effect) {
|
RallyTheAncestorsEffect(final RallyTheAncestorsEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RallyTheAncestorsEffect copy() {
|
public RallyTheAncestorsEffect copy() {
|
||||||
return new RallyTheAncestorsEffect(this);
|
return new RallyTheAncestorsEffect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player player = game.getPlayer(source.getControllerId());
|
Player player = game.getPlayer(source.getControllerId());
|
||||||
|
@ -101,14 +101,15 @@ class RallyTheAncestorsEffect extends OneShotEffect {
|
||||||
Set<Card> cards = player.getGraveyard().getCards(filter, game);
|
Set<Card> cards = player.getGraveyard().getCards(filter, game);
|
||||||
for (Card card : cards) {
|
for (Card card : cards) {
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId());
|
if (player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId())) {
|
||||||
Effect exileEffect = new ExileTargetEffect("Exile those creatures at the beginning of your next upkeep");
|
Effect exileEffect = new ExileTargetEffect("Exile those creatures at the beginning of your next upkeep");
|
||||||
exileEffect.setTargetPointer(new FixedTarget(card.getId()));
|
exileEffect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game)));
|
||||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(exileEffect);
|
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(exileEffect);
|
||||||
delayedAbility.setSourceId(source.getSourceId());
|
delayedAbility.setSourceId(source.getSourceId());
|
||||||
delayedAbility.setControllerId(source.getControllerId());
|
delayedAbility.setControllerId(source.getControllerId());
|
||||||
delayedAbility.setSourceObject(source.getSourceObject(game), game);
|
delayedAbility.setSourceObject(source.getSourceObject(game), game);
|
||||||
game.addDelayedTriggeredAbility(delayedAbility);
|
game.addDelayedTriggeredAbility(delayedAbility);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -77,13 +77,13 @@ public class HellkiteTyrant extends CardImpl {
|
||||||
// Trample
|
// Trample
|
||||||
this.addAbility(TrampleAbility.getInstance());
|
this.addAbility(TrampleAbility.getInstance());
|
||||||
// Whenever Hellkite Tyrant deals combat damage to a player, gain control of all artifacts that player controls.
|
// Whenever Hellkite Tyrant deals combat damage to a player, gain control of all artifacts that player controls.
|
||||||
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new HellkiteTyrantEffect(),false, true));
|
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new HellkiteTyrantEffect(), false, true));
|
||||||
|
|
||||||
// At the beginning of your upkeep, if you control twenty or more artifacts, you win the game.
|
// At the beginning of your upkeep, if you control twenty or more artifacts, you win the game.
|
||||||
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new WinGameSourceControllerEffect(), TargetController.YOU, false);
|
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new WinGameSourceControllerEffect(), TargetController.YOU, false);
|
||||||
this.addAbility(new ConditionalTriggeredAbility(
|
this.addAbility(new ConditionalTriggeredAbility(
|
||||||
ability,
|
ability,
|
||||||
new PermanentsOnTheBattlefieldCondition(new FilterArtifactPermanent(), PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN,19),
|
new PermanentsOnTheBattlefieldCondition(new FilterArtifactPermanent(), PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 19),
|
||||||
"At the beginning of your upkeep, if you control twenty or more artifacts, you win the game."));
|
"At the beginning of your upkeep, if you control twenty or more artifacts, you win the game."));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -123,7 +123,7 @@ class HellkiteTyrantEffect extends OneShotEffect {
|
||||||
FilterPermanent filter = new FilterArtifactPermanent();
|
FilterPermanent filter = new FilterArtifactPermanent();
|
||||||
filter.add(new ControllerIdPredicate(player.getId()));
|
filter.add(new ControllerIdPredicate(player.getId()));
|
||||||
|
|
||||||
List<Permanent> permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId() , game);
|
List<Permanent> permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game);
|
||||||
for (Permanent permanent : permanents) {
|
for (Permanent permanent : permanents) {
|
||||||
ContinuousEffect effect = new HellkiteTyrantControlEffect(source.getControllerId());
|
ContinuousEffect effect = new HellkiteTyrantControlEffect(source.getControllerId());
|
||||||
effect.setTargetPointer(new FixedTarget(permanent.getId()));
|
effect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||||
|
|
Loading…
Reference in a new issue