Implemented Find // Finality

This commit is contained in:
Evan Kranzler 2018-09-10 14:59:46 -04:00
parent c1c8189d0d
commit 816635eaba
2 changed files with 104 additions and 0 deletions

View file

@ -0,0 +1,103 @@
package mage.cards.f;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect;
import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.cards.CardSetInfo;
import mage.cards.SplitCard;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.SpellAbilityType;
import mage.counters.CounterType;
import mage.filter.FilterCard;
import mage.filter.common.FilterCreatureCard;
import mage.game.Game;
import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetCardInYourGraveyard;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author TheElk801
*/
public final class FindFinality extends SplitCard {
private static final FilterCard filter
= new FilterCreatureCard("creature cards from your graveyard");
public FindFinality(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{B/G}{B/G}", "{4}{B}{G}", SpellAbilityType.SPLIT);
// Find
// Return up to two target creature cards from your graveyard to your hand.
this.getLeftHalfCard().getSpellAbility().addEffect(
new ReturnFromGraveyardToHandTargetEffect()
);
this.getLeftHalfCard().getSpellAbility().addTarget(
new TargetCardInYourGraveyard(0, 2, filter)
);
// Finality
// You may put two +1/+1 counters on a creature you control. Then all creatures get -4/-4 until end of turn.
this.getRightHalfCard().getSpellAbility().addEffect(
new FinalityEffect()
);
}
public FindFinality(final FindFinality card) {
super(card);
}
@Override
public FindFinality copy() {
return new FindFinality(this);
}
}
class FinalityEffect extends OneShotEffect {
public FinalityEffect() {
super(Outcome.Benefit);
this.staticText = "You may put two +1/+1 counters "
+ "on a creature you control. "
+ "Then all creatures get -4/-4 until end of turn.";
}
public FinalityEffect(final FinalityEffect effect) {
super(effect);
}
@Override
public FinalityEffect copy() {
return new FinalityEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
Target target = new TargetControlledCreaturePermanent(0, 1);
if (player.choose(
Outcome.BoostCreature, target, source.getSourceId(), game
)) {
Effect effect = new AddCountersTargetEffect(
CounterType.P1P1.createInstance(2)
);
effect.setTargetPointer(new FixedTarget(
target.getFirstTarget(), game
));
effect.apply(game, source);
}
game.addEffect(new BoostAllEffect(-4, -4, Duration.EndOfTurn), source);
return true;
}
}

View file

@ -33,6 +33,7 @@ public final class GuildsOfRavnica extends ExpansionSet {
cards.add(new SetCardInfo("Dimir Informant", 36, Rarity.COMMON, mage.cards.d.DimirInformant.class));
cards.add(new SetCardInfo("Direct Current", 96, Rarity.COMMON, mage.cards.d.DirectCurrent.class));
cards.add(new SetCardInfo("Emmara, Soul of the Accord", 168, Rarity.RARE, mage.cards.e.EmmaraSoulOfTheAccord.class));
cards.add(new SetCardInfo("Find // Finality", 225, Rarity.RARE, mage.cards.f.FindFinality.class));
cards.add(new SetCardInfo("Firemind's Research", 171, Rarity.RARE, mage.cards.f.FiremindsResearch.class));
cards.add(new SetCardInfo("Forest", 264, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Goblin Electromancer", 174, Rarity.COMMON, mage.cards.g.GoblinElectromancer.class));