From f0536b06d41ea4f85e284165a91c5e00b9035ec8 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 19 Feb 2013 17:34:58 +0100 Subject: [PATCH] [PC2] 5 cards. --- .../sets/apocalypse/WhirlpoolWarrior.java | 52 ++++++ .../src/mage/sets/morningtide/RivalsDuel.java | 52 ++++++ .../sets/planechase2012/ElderwoodScion.java | 167 ++++++++++++++++++ .../mage/sets/planechase2012/MassMutiny.java | 134 ++++++++++++++ .../mage/sets/planechase2012/RivalsDuel.java | 134 ++++++++++++++ .../planechase2012/SakashimasStudent.java | 90 ++++++++++ .../sets/planechase2012/WhirlpoolWarrior.java | 164 +++++++++++++++++ 7 files changed, 793 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/apocalypse/WhirlpoolWarrior.java create mode 100644 Mage.Sets/src/mage/sets/morningtide/RivalsDuel.java create mode 100644 Mage.Sets/src/mage/sets/planechase2012/ElderwoodScion.java create mode 100644 Mage.Sets/src/mage/sets/planechase2012/MassMutiny.java create mode 100644 Mage.Sets/src/mage/sets/planechase2012/RivalsDuel.java create mode 100644 Mage.Sets/src/mage/sets/planechase2012/SakashimasStudent.java create mode 100644 Mage.Sets/src/mage/sets/planechase2012/WhirlpoolWarrior.java diff --git a/Mage.Sets/src/mage/sets/apocalypse/WhirlpoolWarrior.java b/Mage.Sets/src/mage/sets/apocalypse/WhirlpoolWarrior.java new file mode 100644 index 0000000000..9a96eb0c0e --- /dev/null +++ b/Mage.Sets/src/mage/sets/apocalypse/WhirlpoolWarrior.java @@ -0,0 +1,52 @@ +/* + * 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.apocalypse; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class WhirlpoolWarrior extends mage.sets.planechase2012.WhirlpoolWarrior { + + public WhirlpoolWarrior(UUID ownerId) { + super(ownerId); + this.cardNumber = 36; + this.expansionSetCode = "APC"; + } + + public WhirlpoolWarrior(final WhirlpoolWarrior card) { + super(card); + } + + @Override + public WhirlpoolWarrior copy() { + return new WhirlpoolWarrior(this); + } +} diff --git a/Mage.Sets/src/mage/sets/morningtide/RivalsDuel.java b/Mage.Sets/src/mage/sets/morningtide/RivalsDuel.java new file mode 100644 index 0000000000..04f01d76b3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/morningtide/RivalsDuel.java @@ -0,0 +1,52 @@ +/* + * 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.morningtide; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class RivalsDuel extends mage.sets.planechase2012.RivalsDuel { + + public RivalsDuel(UUID ownerId) { + super(ownerId); + this.cardNumber = 99; + this.expansionSetCode = "MOR"; + } + + public RivalsDuel(final RivalsDuel card) { + super(card); + } + + @Override + public RivalsDuel copy() { + return new RivalsDuel(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planechase2012/ElderwoodScion.java b/Mage.Sets/src/mage/sets/planechase2012/ElderwoodScion.java new file mode 100644 index 0000000000..cf68733dc5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planechase2012/ElderwoodScion.java @@ -0,0 +1,167 @@ +/* + * 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.planechase2012; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.CostModificationEffectImpl; +import mage.abilities.keyword.LifelinkAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.target.Target; +import mage.util.CardUtil; + +/** + * + * @author LevelX2 + */ +public class ElderwoodScion extends CardImpl { + + public ElderwoodScion(UUID ownerId) { + super(ownerId, 88, "Elderwood Scion", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}{W}"); + this.expansionSetCode = "PC2"; + this.subtype.add("Elemental"); + + this.color.setGreen(true); + this.color.setWhite(true); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + // Lifelink + this.addAbility(LifelinkAbility.getInstance()); + // Spells you cast that target Elderwood Scion cost {2} less to cast. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ElderwoodScionCostReductionEffect())); + // Spells your opponents cast that target Elderwood Scion cost {2} more to cast. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ElderwoodScionCostReductionEffect2())); + } + + public ElderwoodScion(final ElderwoodScion card) { + super(card); + } + + @Override + public ElderwoodScion copy() { + return new ElderwoodScion(this); + } +} + +class ElderwoodScionCostReductionEffect extends CostModificationEffectImpl { + + private static final String effectText = "Spells your opponents cast that target Elderwood Scion cost {2} more to cast"; + + ElderwoodScionCostReductionEffect() { + super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Benefit); + staticText = effectText; + } + + ElderwoodScionCostReductionEffect(ElderwoodScionCostReductionEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source, Ability abilityToModify) { + SpellAbility spellAbility = (SpellAbility) abilityToModify; + CardUtil.adjustCost(spellAbility, 2); + return true; + } + + @Override + public boolean applies(Ability abilityToModify, Ability source, Game game) { + if (abilityToModify instanceof SpellAbility) { + if (abilityToModify.getControllerId().equals(source.getControllerId())) { + for (Target target :abilityToModify.getTargets()) { + for (UUID targetUUID :target.getTargets()) { + if (targetUUID.equals(source.getSourceId())) { + return true; + } + } + } + } + } + return false; + } + + @Override + public ElderwoodScionCostReductionEffect copy() { + return new ElderwoodScionCostReductionEffect(this); + } + +} + +class ElderwoodScionCostReductionEffect2 extends CostModificationEffectImpl { + + private static final String effectText = "Spells you cast that target {this} cost {2} less to cast"; + + ElderwoodScionCostReductionEffect2() { + super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Benefit); + staticText = effectText; + } + + ElderwoodScionCostReductionEffect2(ElderwoodScionCostReductionEffect2 effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source, Ability abilityToModify) { + SpellAbility spellAbility = (SpellAbility) abilityToModify; + CardUtil.adjustCost(spellAbility, -2); + return true; + } + + @Override + public boolean applies(Ability abilityToModify, Ability source, Game game) { + if (abilityToModify instanceof SpellAbility) { + if (game.getOpponents(source.getControllerId()).contains(abilityToModify.getControllerId())) { + for (Target target :abilityToModify.getTargets()) { + for (UUID targetUUID :target.getTargets()) { + if (targetUUID.equals(source.getSourceId())) { + return true; + } + } + } + } + } + return false; + } + + @Override + public ElderwoodScionCostReductionEffect2 copy() { + return new ElderwoodScionCostReductionEffect2(this); + } + +} diff --git a/Mage.Sets/src/mage/sets/planechase2012/MassMutiny.java b/Mage.Sets/src/mage/sets/planechase2012/MassMutiny.java new file mode 100644 index 0000000000..9d5e6dfce9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planechase2012/MassMutiny.java @@ -0,0 +1,134 @@ +/* + * 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.planechase2012; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continious.GainAbilityTargetEffect; +import mage.abilities.effects.common.continious.GainControlTargetEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerIdPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetCreaturePermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author LevelX2 + */ +public class MassMutiny extends CardImpl { + + public MassMutiny(UUID ownerId) { + super(ownerId, 48, "Mass Mutiny", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{R}{R}"); + this.expansionSetCode = "PC2"; + + this.color.setRed(true); + this.getSpellAbility().addEffect(new MassMutinyEffect()); + // For each opponent, gain control of up to one target creature that player controls until end of turn. Untap those creatures. They gain haste until end of turn. + } + + @Override + public void adjustTargets(Ability ability, Game game) { + if (ability instanceof SpellAbility) { + for(UUID opponentId : game.getOpponents(ability.getControllerId())) { + Player opponent = game.getPlayer(opponentId); + if (opponent != null) { + ability.getTargets().clear(); + FilterCreaturePermanent filter = new FilterCreaturePermanent(new StringBuilder("creature from opponent ").append(opponent.getName()).toString()); + filter.add(new ControllerIdPredicate(opponentId)); + TargetCreaturePermanent target = new TargetCreaturePermanent(0,1, filter,false); + ability.addTarget(target); + } + } + } + } + + public MassMutiny(final MassMutiny card) { + super(card); + } + + @Override + public MassMutiny copy() { + return new MassMutiny(this); + } +} + + +class MassMutinyEffect extends OneShotEffect { + + public MassMutinyEffect() { + super(Outcome.GainControl); + this.staticText = "For each opponent, gain control of up to one target creature that player controls until end of turn. Untap those creatures. They gain haste until end of turn"; + } + + public MassMutinyEffect(final MassMutinyEffect effect) { + super(effect); + } + + @Override + public MassMutinyEffect copy() { + return new MassMutinyEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + boolean result = false; + for (Target target: source.getTargets()) { + if (target instanceof TargetCreaturePermanent) { + Permanent targetCreature = game.getPermanent(target.getFirstTarget()); + if (targetCreature != null) { + ContinuousEffect effect1 = new GainControlTargetEffect(Duration.EndOfTurn); + effect1.setTargetPointer(new FixedTarget(targetCreature.getId())); + game.addEffect(effect1, source); + + ContinuousEffect effect2 = new GainAbilityTargetEffect(HasteAbility.getInstance(), Constants.Duration.EndOfTurn); + effect2.setTargetPointer(new FixedTarget(targetCreature.getId())); + game.addEffect(effect2, source); + + targetCreature.untap(game); + result = true; + } + } + } + return result; + } +} diff --git a/Mage.Sets/src/mage/sets/planechase2012/RivalsDuel.java b/Mage.Sets/src/mage/sets/planechase2012/RivalsDuel.java new file mode 100644 index 0000000000..8b9186f28c --- /dev/null +++ b/Mage.Sets/src/mage/sets/planechase2012/RivalsDuel.java @@ -0,0 +1,134 @@ +/* + * 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.planechase2012; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; +import mage.util.CardUtil; + +/** + * + * @author LevelX2 + */ +public class RivalsDuel extends CardImpl { + + public RivalsDuel(UUID ownerId) { + super(ownerId, 51, "Rivals' Duel", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{R}"); + this.expansionSetCode = "PC2"; + + this.color.setRed(true); + + // Choose two target creatures that share no creature types. Those creatures fight each other. + this.getSpellAbility().addTarget(new TargetCreaturePermanentWithDifferentTypes(2)); + this.getSpellAbility().addEffect(new RivalsDuelFightTargetsEffect()); + } + + public RivalsDuel(final RivalsDuel card) { + super(card); + } + + @Override + public RivalsDuel copy() { + return new RivalsDuel(this); + } +} + +class TargetCreaturePermanentWithDifferentTypes extends TargetCreaturePermanent { + + public TargetCreaturePermanentWithDifferentTypes(int numTargets) { + super(numTargets); + } + + public TargetCreaturePermanentWithDifferentTypes(final TargetCreaturePermanentWithDifferentTypes target) { + super(target); + } + + @Override + public TargetCreaturePermanentWithDifferentTypes copy() { + return new TargetCreaturePermanentWithDifferentTypes(this); + } + + @Override + public boolean canTarget(UUID id, Game game) { + if (super.canTarget(id, game)) { + Permanent creature = game.getPermanent(id); + if (creature != null) { + for (Object object : getTargets()) { + UUID targetId = (UUID) object; + Permanent selectedCreature = game.getPermanent(targetId); + if (CardUtil.shareSubtypes(creature, selectedCreature)) { + return false; + } + } + return true; + } + } + return false; + } +} + +class RivalsDuelFightTargetsEffect extends OneShotEffect { + + public RivalsDuelFightTargetsEffect() { + super(Outcome.Damage); + staticText = "Choose two target creatures that share no creature types. Those creatures fight each other"; + } + + public RivalsDuelFightTargetsEffect(final RivalsDuelFightTargetsEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + TargetCreaturePermanentWithDifferentTypes target = (TargetCreaturePermanentWithDifferentTypes) source.getTargets().get(0); + Permanent creature1 = game.getPermanent(target.getFirstTarget()); + Permanent creature2 = game.getPermanent((UUID) target.getTargets().get(1)); + // 20110930 - 701.10 + if (creature1 != null && creature2 != null) { + if (creature1.getCardType().contains(CardType.CREATURE) && creature2.getCardType().contains(CardType.CREATURE)) { + creature1.damage(creature2.getPower().getValue(), creature2.getId(), game, true, false); + creature2.damage(creature1.getPower().getValue(), creature1.getId(), game, true, false); + return true; + } + } + return false; + } + + @Override + public RivalsDuelFightTargetsEffect copy() { + return new RivalsDuelFightTargetsEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planechase2012/SakashimasStudent.java b/Mage.Sets/src/mage/sets/planechase2012/SakashimasStudent.java new file mode 100644 index 0000000000..fa7104defd --- /dev/null +++ b/Mage.Sets/src/mage/sets/planechase2012/SakashimasStudent.java @@ -0,0 +1,90 @@ +/* + * 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.planechase2012; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.EntersBattlefieldEffect; +import mage.abilities.effects.common.CopyPermanentEffect; +import mage.abilities.keyword.NinjutsuAbility; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.util.functions.ApplyToPermanent; + +/** + * + * @author LevelX2 + */ +public class SakashimasStudent extends CardImpl { + + public SakashimasStudent(UUID ownerId) { + super(ownerId, 24, "Sakashima's Student", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); + this.expansionSetCode = "PC2"; + this.subtype.add("Human"); + this.subtype.add("Ninja"); + + this.color.setBlue(true); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Ninjutsu {1}{U} + this.addAbility(new NinjutsuAbility(new ManaCostsImpl("{1}{U}"))); + // You may have Sakashima's Student enter the battlefield as a copy of any creature on the battlefield, except it's still a Ninja in addition to its other creature types. + this.addAbility(new SimpleStaticAbility( + Constants.Zone.BATTLEFIELD, + new EntersBattlefieldEffect(new CopyPermanentEffect(new SakashimasStudentApplyToPermanent()), + "You may have {this} enter the battlefield as a copy of any creature on the battlefield, except it's still a Ninja in addition to its other creature types"))); + + } + + public SakashimasStudent(final SakashimasStudent card) { + super(card); + } + + @Override + public SakashimasStudent copy() { + return new SakashimasStudent(this); + } +} + +class SakashimasStudentApplyToPermanent extends ApplyToPermanent { + + @Override + public Boolean apply(Game game, Permanent permanent) { + if (!permanent.getSubtype().contains("Ninja")) { + permanent.getSubtype().add("Ninja"); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/planechase2012/WhirlpoolWarrior.java b/Mage.Sets/src/mage/sets/planechase2012/WhirlpoolWarrior.java new file mode 100644 index 0000000000..3763e23ffd --- /dev/null +++ b/Mage.Sets/src/mage/sets/planechase2012/WhirlpoolWarrior.java @@ -0,0 +1,164 @@ +/* + * 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.planechase2012; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ +public class WhirlpoolWarrior extends CardImpl { + + public WhirlpoolWarrior(UUID ownerId) { + super(ownerId, 29, "Whirlpool Warrior", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "PC2"; + this.subtype.add("Merfolk"); + this.subtype.add("Warrior"); + + this.color.setBlue(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When Whirlpool Warrior enters the battlefield, shuffle the cards from your hand into your library, then draw that many cards. + this.addAbility(new EntersBattlefieldTriggeredAbility(new WhirlpoolWarriorTriggeredEffect())); + + // {R}, Sacrifice Whirlpool Warrior: Each player shuffles the cards from his or her hand into his or her library, then draws that many cards. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new WhirlpoolWarriorActivatedEffect(), new ManaCostsImpl("{R}")); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public WhirlpoolWarrior(final WhirlpoolWarrior card) { + super(card); + } + + @Override + public WhirlpoolWarrior copy() { + return new WhirlpoolWarrior(this); + } +} + +class WhirlpoolWarriorTriggeredEffect extends OneShotEffect { + + public WhirlpoolWarriorTriggeredEffect() { + super(Outcome.DrawCard); + this.staticText = "shuffle the cards from your hand into your library, then draw that many cards"; + } + + public WhirlpoolWarriorTriggeredEffect(final WhirlpoolWarriorTriggeredEffect effect) { + super(effect); + } + + @Override + public WhirlpoolWarriorTriggeredEffect copy() { + return new WhirlpoolWarriorTriggeredEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + int cardsHand = controller.getHand().size(); + if (cardsHand > 0){ + Cards cards = controller.getHand(); + for (UUID cardId: cards) { + Card card = game.getCard(cardId); + if (card != null) { + controller.removeFromHand(card, game); + card.moveToZone(Zone.LIBRARY, source.getId(), game, true); + } + } + controller.shuffleLibrary(game); + controller.drawCards(cardsHand, game); + return true; + } + } + + return false; + } +} + +class WhirlpoolWarriorActivatedEffect extends OneShotEffect { + + public WhirlpoolWarriorActivatedEffect() { + super(Outcome.Benefit); + this.staticText = "Each player shuffles the cards from his or her hand into his or her library, then draws that many cards"; + } + + public WhirlpoolWarriorActivatedEffect(final WhirlpoolWarriorActivatedEffect effect) { + super(effect); + } + + @Override + public WhirlpoolWarriorActivatedEffect copy() { + return new WhirlpoolWarriorActivatedEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + for (UUID playerId : controller.getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null) { + int cardsHand = player.getHand().size(); + if (cardsHand > 0){ + for (UUID cardId: player.getHand()) { + Card card = game.getCard(cardId); + if (card != null) { + player.removeFromHand(card, game); + card.moveToZone(Zone.LIBRARY, source.getId(), game, true); + } + } + player.shuffleLibrary(game); + player.drawCards(cardsHand, game); + } + } + } + return true; + } + return false; + } +}