mirror of
https://github.com/correl/mage.git
synced 2024-12-24 03:00:14 +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.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.abilities.effects.common.ExileSpellEffect;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
|
@ -76,21 +76,21 @@ public class RallyTheAncestors extends CardImpl {
|
|||
}
|
||||
|
||||
class RallyTheAncestorsEffect extends OneShotEffect {
|
||||
|
||||
|
||||
RallyTheAncestorsEffect() {
|
||||
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";
|
||||
}
|
||||
|
||||
|
||||
RallyTheAncestorsEffect(final RallyTheAncestorsEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public RallyTheAncestorsEffect copy() {
|
||||
return new RallyTheAncestorsEffect(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
|
@ -101,14 +101,15 @@ class RallyTheAncestorsEffect extends OneShotEffect {
|
|||
Set<Card> cards = player.getGraveyard().getCards(filter, game);
|
||||
for (Card card : cards) {
|
||||
if (card != null) {
|
||||
player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId());
|
||||
Effect exileEffect = new ExileTargetEffect("Exile those creatures at the beginning of your next upkeep");
|
||||
exileEffect.setTargetPointer(new FixedTarget(card.getId()));
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(exileEffect);
|
||||
delayedAbility.setSourceId(source.getSourceId());
|
||||
delayedAbility.setControllerId(source.getControllerId());
|
||||
delayedAbility.setSourceObject(source.getSourceObject(game), game);
|
||||
game.addDelayedTriggeredAbility(delayedAbility);
|
||||
if (player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId())) {
|
||||
Effect exileEffect = new ExileTargetEffect("Exile those creatures at the beginning of your next upkeep");
|
||||
exileEffect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game)));
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(exileEffect);
|
||||
delayedAbility.setSourceId(source.getSourceId());
|
||||
delayedAbility.setControllerId(source.getControllerId());
|
||||
delayedAbility.setSourceObject(source.getSourceObject(game), game);
|
||||
game.addDelayedTriggeredAbility(delayedAbility);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -77,13 +77,13 @@ public class HellkiteTyrant extends CardImpl {
|
|||
// Trample
|
||||
this.addAbility(TrampleAbility.getInstance());
|
||||
// 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.
|
||||
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new WinGameSourceControllerEffect(), TargetController.YOU, false);
|
||||
this.addAbility(new ConditionalTriggeredAbility(
|
||||
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."));
|
||||
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ class HellkiteTyrantEffect extends OneShotEffect {
|
|||
FilterPermanent filter = new FilterArtifactPermanent();
|
||||
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) {
|
||||
ContinuousEffect effect = new HellkiteTyrantControlEffect(source.getControllerId());
|
||||
effect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
|
|
Loading…
Reference in a new issue