diff --git a/Mage.Sets/src/mage/sets/alarareborn/DragonAppeasement.java b/Mage.Sets/src/mage/sets/alarareborn/DragonAppeasement.java new file mode 100644 index 00000000000..7ebc43da3ca --- /dev/null +++ b/Mage.Sets/src/mage/sets/alarareborn/DragonAppeasement.java @@ -0,0 +1,143 @@ +/* + * 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.alarareborn; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.effects.common.DrawCardControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; + +/** + * + * @author jeffwadsworth + */ +public class DragonAppeasement extends CardImpl { + + public DragonAppeasement(UUID ownerId) { + super(ownerId, 115, "Dragon Appeasement", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}{R}{G}"); + this.expansionSetCode = "ARB"; + + this.color.setRed(true); + this.color.setGreen(true); + this.color.setBlack(true); + + // Skip your draw step. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SkipYourDrawStepEffect())); + + // Whenever you sacrifice a creature, you may draw a card. + this.addAbility(new DragonAppeasementTriggeredAbility()); + + } + + public DragonAppeasement(final DragonAppeasement card) { + super(card); + } + + @Override + public DragonAppeasement copy() { + return new DragonAppeasement(this); + } +} + +class SkipYourDrawStepEffect extends ReplacementEffectImpl { + + public SkipYourDrawStepEffect() { + super(Duration.WhileOnBattlefield, Outcome.Neutral); + staticText = "Skip your draw step"; + } + + public SkipYourDrawStepEffect(final SkipYourDrawStepEffect effect) { + super(effect); + } + + @Override + public SkipYourDrawStepEffect copy() { + return new SkipYourDrawStepEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return true; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == GameEvent.EventType.DRAW_STEP + && (event.getPlayerId().equals(source.getControllerId()))) { + return true; + } + return false; + } +} + +class DragonAppeasementTriggeredAbility extends TriggeredAbilityImpl { + + public DragonAppeasementTriggeredAbility() { + super(Zone.BATTLEFIELD, new DrawCardControllerEffect(1), true); + } + + public DragonAppeasementTriggeredAbility(final DragonAppeasementTriggeredAbility ability) { + super(ability); + } + + @Override + public DragonAppeasementTriggeredAbility copy() { + return new DragonAppeasementTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.SACRIFICED_PERMANENT + && event.getPlayerId().equals(this.getControllerId()) + && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getCardType().contains(CardType.CREATURE)) { + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever you sacrifice a creature, " + super.getRule(); + } +} + diff --git a/Mage.Sets/src/mage/sets/alarareborn/JundSojourners.java b/Mage.Sets/src/mage/sets/alarareborn/JundSojourners.java new file mode 100644 index 00000000000..f3fd621bd93 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alarareborn/JundSojourners.java @@ -0,0 +1,81 @@ +/* + * 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.alarareborn; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.CycleTriggeredAbility; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.CyclingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author jeffwadsworth + */ +public class JundSojourners extends CardImpl { + + public JundSojourners(UUID ownerId) { + super(ownerId, 116, "Jund Sojourners", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}{R}{G}"); + this.expansionSetCode = "ARB"; + this.subtype.add("Viashino"); + this.subtype.add("Shaman"); + + this.color.setRed(true); + this.color.setGreen(true); + this.color.setBlack(true); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // When you cycle Jund Sojourners or it dies, you may have it deal 1 damage to target creature or player. + Ability ability1 = new CycleTriggeredAbility(new DamageTargetEffect(1)); + Ability ability2 = new DiesTriggeredAbility(new DamageTargetEffect(1)); + ability1.addTarget(new TargetCreatureOrPlayer()); + ability2.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability1); + this.addAbility(ability2); + + // Cycling {2}{R} + this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}{R}"))); + } + + public JundSojourners(final JundSojourners card) { + super(card); + } + + @Override + public JundSojourners copy() { + return new JundSojourners(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alarareborn/KarrthusTyrantOfJund.java b/Mage.Sets/src/mage/sets/alarareborn/KarrthusTyrantOfJund.java new file mode 100644 index 00000000000..c9466738412 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alarareborn/KarrthusTyrantOfJund.java @@ -0,0 +1,169 @@ +/* + * 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.alarareborn; + +import java.util.List; +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continious.GainAbilityAllEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author jeffwadsworth + */ +public class KarrthusTyrantOfJund extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("all dragons you control"); + + static { + filter.add(new ControllerPredicate(TargetController.YOU)); + filter.add(new SubtypePredicate("Dragon")); + } + + public KarrthusTyrantOfJund(UUID ownerId) { + super(ownerId, 117, "Karrthus, Tyrant of Jund", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{B}{R}{G}"); + this.expansionSetCode = "ARB"; + this.supertype.add("Legendary"); + this.subtype.add("Dragon"); + + this.color.setRed(true); + this.color.setGreen(true); + this.color.setBlack(true); + this.power = new MageInt(7); + this.toughness = new MageInt(7); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Haste + this.addAbility(HasteAbility.getInstance()); + + // When Karrthus, Tyrant of Jund enters the battlefield, gain control of all Dragons, then untap all Dragons. + this.addAbility(new EntersBattlefieldTriggeredAbility(new KarrthusEffect())); + + // Other Dragon creatures you control have haste. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, filter, true))); + + } + + public KarrthusTyrantOfJund(final KarrthusTyrantOfJund card) { + super(card); + } + + @Override + public KarrthusTyrantOfJund copy() { + return new KarrthusTyrantOfJund(this); + } +} + +class KarrthusEffect extends OneShotEffect { + + public KarrthusEffect() { + super(Outcome.GainControl); + this.staticText = "gain control of all dragons"; + } + + public KarrthusEffect(final KarrthusEffect effect) { + super(effect); + } + + @Override + public KarrthusEffect copy() { + return new KarrthusEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + FilterPermanent filter = new FilterPermanent(); + filter.add(new SubtypePredicate("Dragon")); + List dragons = game.getBattlefield().getAllActivePermanents(filter, game); + for (Permanent dragon : dragons) { + ContinuousEffect effect = new KarrthusControlEffect(source.getControllerId()); + effect.setTargetPointer(new FixedTarget(dragon.getId())); + game.addEffect(effect, source); + } + for (Permanent dragon : dragons) { + dragon.untap(game); + } + return true; + } +} + +class KarrthusControlEffect extends ContinuousEffectImpl { + + private UUID controllerId; + + public KarrthusControlEffect(UUID controllerId) { + super(Duration.WhileOnBattlefield, Layer.ControlChangingEffects_2, SubLayer.NA, Outcome.GainControl); + this.controllerId = controllerId; + } + + public KarrthusControlEffect(final KarrthusControlEffect effect) { + super(effect); + this.controllerId = effect.controllerId; + } + + @Override + public KarrthusControlEffect copy() { + return new KarrthusControlEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent dragon = game.getPermanent(targetPointer.getFirst(game, source)); + if (dragon != null && controllerId != null) { + return dragon.changeControllerId(controllerId, game); + } + return false; + } +}