mirror of
https://github.com/correl/mage.git
synced 2025-04-13 01:01:11 -09:00
[NCC] Implemented Determined Iteration
This commit is contained in:
parent
05c4419cdd
commit
bfc0b2094a
3 changed files with 94 additions and 3 deletions
Mage.Sets/src/mage
Mage/src/main/java/mage/abilities/effects/common
79
Mage.Sets/src/mage/cards/d/DeterminedIteration.java
Normal file
79
Mage.Sets/src/mage/cards/d/DeterminedIteration.java
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
package mage.cards.d;
|
||||||
|
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.common.BeginningOfCombatTriggeredAbility;
|
||||||
|
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
||||||
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.abilities.effects.common.PopulateEffect;
|
||||||
|
import mage.abilities.effects.common.SacrificeTargetEffect;
|
||||||
|
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||||
|
import mage.abilities.keyword.HasteAbility;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Duration;
|
||||||
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.TargetController;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.target.targetpointer.FixedTargets;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author TheElk801
|
||||||
|
*/
|
||||||
|
public final class DeterminedIteration extends CardImpl {
|
||||||
|
|
||||||
|
public DeterminedIteration(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}");
|
||||||
|
|
||||||
|
// At the beginning of combat on your turn, populate. The token created this way gains haste. Sacrifice it at the beginning of the next end step.
|
||||||
|
this.addAbility(new BeginningOfCombatTriggeredAbility(
|
||||||
|
new DeterminedIterationEffect(), TargetController.YOU, false
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
private DeterminedIteration(final DeterminedIteration card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DeterminedIteration copy() {
|
||||||
|
return new DeterminedIteration(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class DeterminedIterationEffect extends OneShotEffect {
|
||||||
|
|
||||||
|
DeterminedIterationEffect() {
|
||||||
|
super(Outcome.Benefit);
|
||||||
|
staticText = "populate. The token created this way gains haste. Sacrifice it at the beginning of the " +
|
||||||
|
"next end step. <i>(To populate, create a token that's a copy of a creature token you control.)</i>";
|
||||||
|
}
|
||||||
|
|
||||||
|
private DeterminedIterationEffect(final DeterminedIterationEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DeterminedIterationEffect copy() {
|
||||||
|
return new DeterminedIterationEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
PopulateEffect effect = new PopulateEffect();
|
||||||
|
effect.apply(game, source);
|
||||||
|
if (effect.getAddedPermanents().isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
game.addEffect(new GainAbilityTargetEffect(
|
||||||
|
HasteAbility.getInstance(), Duration.Custom
|
||||||
|
).setTargetPointer(new FixedTargets(effect.getAddedPermanents(), game)), source);
|
||||||
|
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(
|
||||||
|
new SacrificeTargetEffect("sacrifice the token")
|
||||||
|
.setTargetPointer(new FixedTargets(effect.getAddedPermanents(), game))
|
||||||
|
), source);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
|
@ -94,6 +94,7 @@ public final class NewCapennaCommander extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Deathreap Ritual", 336, Rarity.UNCOMMON, mage.cards.d.DeathreapRitual.class));
|
cards.add(new SetCardInfo("Deathreap Ritual", 336, Rarity.UNCOMMON, mage.cards.d.DeathreapRitual.class));
|
||||||
cards.add(new SetCardInfo("Declaration in Stone", 196, Rarity.RARE, mage.cards.d.DeclarationInStone.class));
|
cards.add(new SetCardInfo("Declaration in Stone", 196, Rarity.RARE, mage.cards.d.DeclarationInStone.class));
|
||||||
cards.add(new SetCardInfo("Deep Analysis", 218, Rarity.COMMON, mage.cards.d.DeepAnalysis.class));
|
cards.add(new SetCardInfo("Deep Analysis", 218, Rarity.COMMON, mage.cards.d.DeepAnalysis.class));
|
||||||
|
cards.add(new SetCardInfo("Determined Iteration", 45, Rarity.RARE, mage.cards.d.DeterminedIteration.class));
|
||||||
cards.add(new SetCardInfo("Devoted Druid", 286, Rarity.UNCOMMON, mage.cards.d.DevotedDruid.class));
|
cards.add(new SetCardInfo("Devoted Druid", 286, Rarity.UNCOMMON, mage.cards.d.DevotedDruid.class));
|
||||||
cards.add(new SetCardInfo("Dig Through Time", 219, Rarity.RARE, mage.cards.d.DigThroughTime.class));
|
cards.add(new SetCardInfo("Dig Through Time", 219, Rarity.RARE, mage.cards.d.DigThroughTime.class));
|
||||||
cards.add(new SetCardInfo("Dimir Signet", 365, Rarity.COMMON, mage.cards.d.DimirSignet.class));
|
cards.add(new SetCardInfo("Dimir Signet", 365, Rarity.COMMON, mage.cards.d.DimirSignet.class));
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package mage.abilities.effects.common;
|
package mage.abilities.effects.common;
|
||||||
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.Effect;
|
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.TargetController;
|
import mage.constants.TargetController;
|
||||||
|
@ -15,6 +14,9 @@ import mage.target.Target;
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
import mage.target.targetpointer.FixedTarget;
|
import mage.target.targetpointer.FixedTarget;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
|
@ -31,6 +33,7 @@ public class PopulateEffect extends OneShotEffect {
|
||||||
|
|
||||||
private final boolean tappedAndAttacking;
|
private final boolean tappedAndAttacking;
|
||||||
private static final FilterPermanent filter = new FilterCreaturePermanent("creature token for populate");
|
private static final FilterPermanent filter = new FilterCreaturePermanent("creature token for populate");
|
||||||
|
private final List<Permanent> addedTokenPermanents = new ArrayList<>();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
filter.add(TokenPredicate.TRUE);
|
filter.add(TokenPredicate.TRUE);
|
||||||
|
@ -56,6 +59,7 @@ public class PopulateEffect extends OneShotEffect {
|
||||||
public PopulateEffect(final PopulateEffect effect) {
|
public PopulateEffect(final PopulateEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
this.tappedAndAttacking = effect.tappedAndAttacking;
|
this.tappedAndAttacking = effect.tappedAndAttacking;
|
||||||
|
this.addedTokenPermanents.addAll(effect.addedTokenPermanents);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -75,11 +79,18 @@ public class PopulateEffect extends OneShotEffect {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
game.informPlayers("Token selected for populate: " + tokenToCopy.getLogName());
|
game.informPlayers("Token selected for populate: " + tokenToCopy.getLogName());
|
||||||
Effect effect = new CreateTokenCopyTargetEffect(
|
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(
|
||||||
null, null, false, 1, tappedAndAttacking, tappedAndAttacking
|
null, null, false, 1, tappedAndAttacking, tappedAndAttacking
|
||||||
);
|
);
|
||||||
effect.setTargetPointer(new FixedTarget(target.getFirstTarget(), game));
|
effect.setTargetPointer(new FixedTarget(target.getFirstTarget(), game));
|
||||||
return effect.apply(game, source);
|
effect.apply(game, source);
|
||||||
|
this.addedTokenPermanents.clear();
|
||||||
|
this.addedTokenPermanents.addAll(effect.getAddedPermanents());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Permanent> getAddedPermanents() {
|
||||||
|
return addedTokenPermanents;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Add table
Reference in a new issue