diff --git a/Mage.Sets/src/mage/sets/futuresight/InterventionPact.java b/Mage.Sets/src/mage/sets/futuresight/InterventionPact.java new file mode 100644 index 0000000000..0672b0be14 --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/InterventionPact.java @@ -0,0 +1,145 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.futuresight; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.delayed.PactDelayedTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.PreventionEffectImpl; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetSource; + +/** + * + * @author Plopman + */ +public class InterventionPact extends CardImpl { + + public InterventionPact(UUID ownerId) { + super(ownerId, 8, "Intervention Pact", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{0}"); + this.expansionSetCode = "FUT"; + + this.color.setWhite(true); + + // The next time a source of your choice would deal damage to you this turn, prevent that damage. You gain life equal to the damage prevented this way. + this.getSpellAbility().addEffect(new InterventionPactPreventDamageEffect()); + this.getSpellAbility().addTarget(new TargetSource()); + // At the beginning of your next upkeep, pay {1}{W}{W}. If you don't, you lose the game. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new PactDelayedTriggeredAbility(new ManaCostsImpl("{1}{W}{W}")))); + } + + public InterventionPact(final InterventionPact card) { + super(card); + } + + @Override + public InterventionPact copy() { + return new InterventionPact(this); + } +} + + +class InterventionPactPreventDamageEffect extends PreventionEffectImpl { + + + public InterventionPactPreventDamageEffect() { + super(Constants.Duration.EndOfTurn); + staticText = "The next time a source of your choice would deal damage to you this turn, prevent that damage. You gain life equal to the damage prevented this way"; + } + + public InterventionPactPreventDamageEffect(final InterventionPactPreventDamageEffect effect) { + super(effect); + } + + @Override + public InterventionPactPreventDamageEffect copy() { + return new InterventionPactPreventDamageEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), event.getAmount(), false); + if (!game.replaceEvent(preventEvent)) { + int prevented = event.getAmount(); + event.setAmount(0); + this.used = true; + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), prevented)); + + + + if (prevented > 0) { + Player player = game .getPlayer(source.getControllerId()); + if(player != null){ + player.gainLife(prevented, game); + } + } + } + return false; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (!this.used && super.applies(event, source, game)) { + + + MageObject object = game.getObject(event.getSourceId()); + if (object == null) { + game.informPlayers("Couldn't find source of damage"); + return false; + } + + if (!object.getId().equals(source.getFirstTarget())) { + return false; + } + + Player player = game.getPlayer(event.getTargetId()); + if (player != null) { + if (player.getId().equals(source.getControllerId())) { + return true; + } + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/PactOfNegation.java b/Mage.Sets/src/mage/sets/futuresight/PactOfNegation.java new file mode 100644 index 0000000000..e42d371d4e --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/PactOfNegation.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.futuresight; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.common.delayed.PactDelayedTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.cards.CardImpl; +import mage.target.TargetSpell; + +/** + * + * @author Plopman + */ +public class PactOfNegation extends CardImpl { + + public PactOfNegation(UUID ownerId) { + super(ownerId, 42, "Pact of Negation", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{0}"); + this.expansionSetCode = "FUT"; + + this.color.setBlue(true); + + // Counter target spell. + this.getSpellAbility().addTarget(new TargetSpell()); + this.getSpellAbility().addEffect(new CounterTargetEffect()); + // At the beginning of your next upkeep, pay {3}{U}{U}. If you don't, you lose the game. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new PactDelayedTriggeredAbility(new ManaCostsImpl("{3}{U}{U}")))); + } + + public PactOfNegation(final PactOfNegation card) { + super(card); + } + + @Override + public PactOfNegation copy() { + return new PactOfNegation(this); + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/PactOfTheTitan.java b/Mage.Sets/src/mage/sets/futuresight/PactOfTheTitan.java new file mode 100644 index 0000000000..7e6fd33e89 --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/PactOfTheTitan.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.futuresight; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.common.delayed.PactDelayedTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.game.permanent.token.Token; + +/** + * + * @author Plopman + */ +public class PactOfTheTitan extends CardImpl { + + public PactOfTheTitan(UUID ownerId) { + super(ownerId, 103, "Pact of the Titan", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{0}"); + this.expansionSetCode = "FUT"; + + this.color.setRed(true); + + // Put a 4/4 red Giant creature token onto the battlefield. + this.getSpellAbility().addEffect(new CreateTokenEffect(new GiantToken())); + // At the beginning of your next upkeep, pay {4}{R}. If you don't, you lose the game. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new PactDelayedTriggeredAbility(new ManaCostsImpl("{4}{R}")))); + } + + public PactOfTheTitan(final PactOfTheTitan card) { + super(card); + } + + @Override + public PactOfTheTitan copy() { + return new PactOfTheTitan(this); + } +} + +class GiantToken extends Token { + + public GiantToken() { + super("Giant", "a 4/4 red Giant creature token"); + cardType.add(CardType.CREATURE); + subtype.add("Giant"); + color.setRed(true); + power = new MageInt(4); + toughness = new MageInt(4); + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/SlaughterPact.java b/Mage.Sets/src/mage/sets/futuresight/SlaughterPact.java new file mode 100644 index 0000000000..5b610b8c4c --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/SlaughterPact.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.futuresight; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.ObjectColor; +import mage.abilities.common.delayed.PactDelayedTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Plopman + */ +public class SlaughterPact extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); + + static { + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); + } + + public SlaughterPact(UUID ownerId) { + super(ownerId, 78, "Slaughter Pact", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{0}"); + this.expansionSetCode = "FUT"; + + this.color.setBlack(true); + + // Destroy target nonblack creature. + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + // At the beginning of your next upkeep, pay {2}{B}. If you don't, you lose the game. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new PactDelayedTriggeredAbility(new ManaCostsImpl("{2}{B}")))); + } + + public SlaughterPact(final SlaughterPact card) { + super(card); + } + + @Override + public SlaughterPact copy() { + return new SlaughterPact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/SummonersPact.java b/Mage.Sets/src/mage/sets/futuresight/SummonersPact.java new file mode 100644 index 0000000000..6e9b8d0b80 --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/SummonersPact.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.futuresight; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.ObjectColor; +import mage.abilities.common.delayed.PactDelayedTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; +import mage.cards.CardImpl; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author Plopman + */ +public class SummonersPact extends CardImpl { + + private static final FilterCard filter = new FilterCreatureCard("green creature card"); + static{ + filter.add(new ColorPredicate(ObjectColor.GREEN)); + } + public SummonersPact(UUID ownerId) { + super(ownerId, 139, "Summoner's Pact", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{0}"); + this.expansionSetCode = "FUT"; + + this.color.setGreen(true); + + // Search your library for a green creature card, reveal it, and put it into your hand. Then shuffle your library. + this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true, true)); + // At the beginning of your next upkeep, pay {2}{G}{G}. If you don't, you lose the game. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new PactDelayedTriggeredAbility(new ManaCostsImpl("{2}{G}{G}")))); + } + + public SummonersPact(final SummonersPact card) { + super(card); + } + + @Override + public SummonersPact copy() { + return new SummonersPact(this); + } +} diff --git a/Mage/src/mage/abilities/common/delayed/PactDelayedTriggeredAbility.java b/Mage/src/mage/abilities/common/delayed/PactDelayedTriggeredAbility.java new file mode 100644 index 0000000000..117d81a454 --- /dev/null +++ b/Mage/src/mage/abilities/common/delayed/PactDelayedTriggeredAbility.java @@ -0,0 +1,117 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.abilities.common.delayed; + +import mage.Constants; +import mage.Constants.Outcome; +import mage.abilities.Ability; +import mage.abilities.DelayedTriggeredAbility; +import mage.abilities.costs.mana.ManaCost; +import mage.abilities.costs.mana.ManaCosts; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.token.Token; +import mage.players.Player; + +/** + * @author nantuko + */ +public class PactDelayedTriggeredAbility extends DelayedTriggeredAbility { + + public PactDelayedTriggeredAbility(ManaCosts cost) { + super(new PactEffect(cost)); + } + + + public PactDelayedTriggeredAbility(PactDelayedTriggeredAbility ability) { + super(ability); + } + + @Override + public PactDelayedTriggeredAbility copy() { + return new PactDelayedTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE && game.getActivePlayerId().equals(this.getControllerId())) { + return true; + } + return false; + } + + @Override + public String getRule() { + return "At the beginning of your next upkeep " + modes.getText(); + } +} + +class PactEffect extends OneShotEffect { + + private ManaCosts cost; + + + public PactEffect(ManaCosts cost) { + super(Constants.Outcome.Neutral); + this.cost = cost; + staticText = "pay " + cost.getText() + ". If you don't, you lose the game"; + } + + public PactEffect(final PactEffect effect) { + super(effect); + this.cost = effect.cost; + } + + @Override + public PactEffect copy() { + return new PactEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + if (player.chooseUse(Outcome.Benefit, "Pay " + cost.getText() + "?", game)) { + cost.clearPaid(); + if (cost.pay(source, game, source.getId(), source.getControllerId(), false)){ + return true; + } + } + player.lost(game); + return true; + } + return false; + } + + + +}