From bb4f145bb6e8b6d84512e89423d5936d43e73089 Mon Sep 17 00:00:00 2001 From: Brian Hill Date: Fri, 12 Jun 2015 10:22:28 -0400 Subject: [PATCH 1/5] Initial work on Dreamborn Muse --- .../mage/sets/commander/DreambornMuse.java | 52 ++++++++++++++ .../src/mage/sets/legions/DreambornMuse.java | 69 +++++++++++++++++++ .../mage/sets/tenthedition/DreambornMuse.java | 52 ++++++++++++++ .../common/CardsInTargetHandCount.java | 31 +++++++++ 4 files changed, 204 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/commander/DreambornMuse.java create mode 100644 Mage.Sets/src/mage/sets/legions/DreambornMuse.java create mode 100644 Mage.Sets/src/mage/sets/tenthedition/DreambornMuse.java create mode 100644 Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetHandCount.java diff --git a/Mage.Sets/src/mage/sets/commander/DreambornMuse.java b/Mage.Sets/src/mage/sets/commander/DreambornMuse.java new file mode 100644 index 0000000000..93fbd3f00b --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander/DreambornMuse.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.commander; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class DreambornMuse extends mage.sets.legions.DreambornMuse { + + public DreambornMuse(UUID ownerId) { + super(ownerId); + this.cardNumber = 44; + this.expansionSetCode = "CMD"; + } + + public DreambornMuse(final DreambornMuse card) { + super(card); + } + + @Override + public DreambornMuse copy() { + return new DreambornMuse(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/DreambornMuse.java b/Mage.Sets/src/mage/sets/legions/DreambornMuse.java new file mode 100644 index 0000000000..418e75355e --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/DreambornMuse.java @@ -0,0 +1,69 @@ +/* + * 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.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.dynamicvalue.common.CardsInTargetHandCount; +import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; + +/** + * + * @author cbrianhill + */ +public class DreambornMuse extends CardImpl { + + public DreambornMuse(UUID ownerId) { + super(ownerId, 36, "Dreamborn Muse", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Spirit"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // At the beginning of each player's upkeep, that player puts the top X cards of his or her library into his or her graveyard, where X is the number of cards in his or her hand. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new PutLibraryIntoGraveTargetEffect(new CardsInTargetHandCount()), TargetController.ANY, false)); + } + + public DreambornMuse(final DreambornMuse card) { + super(card); + } + + @Override + public DreambornMuse copy() { + return new DreambornMuse(this); + } +} + +class DreambornMuseEffect { + +} diff --git a/Mage.Sets/src/mage/sets/tenthedition/DreambornMuse.java b/Mage.Sets/src/mage/sets/tenthedition/DreambornMuse.java new file mode 100644 index 0000000000..5971c0c184 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tenthedition/DreambornMuse.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.tenthedition; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class DreambornMuse extends mage.sets.legions.DreambornMuse { + + public DreambornMuse(UUID ownerId) { + super(ownerId); + this.cardNumber = 82; + this.expansionSetCode = "10E"; + } + + public DreambornMuse(final DreambornMuse card) { + super(card); + } + + @Override + public DreambornMuse copy() { + return new DreambornMuse(this); + } +} diff --git a/Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetHandCount.java b/Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetHandCount.java new file mode 100644 index 0000000000..4bff7fb799 --- /dev/null +++ b/Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetHandCount.java @@ -0,0 +1,31 @@ +package mage.abilities.dynamicvalue.common; + +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author cbrianhill + */ +public class CardsInTargetHandCount implements DynamicValue { + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + Player player = game.getPlayer(sourceAbility.getFirstTarget()); + return player.getHand().size(); + } + + @Override + public DynamicValue copy() { + return new CardsInTargetHandCount(); + } + + @Override + public String getMessage() { + return "cards in target player's hand"; + } + +} From b29bb5ac155d48f1d08fa3849573fb492b0e560b Mon Sep 17 00:00:00 2001 From: Brian Hill Date: Mon, 15 Jun 2015 22:09:31 -0400 Subject: [PATCH 2/5] Finish adding Dreamborn Muse --- Mage.Sets/src/mage/sets/legions/DreambornMuse.java | 12 ++++++------ ...dCount.java => CardsInTargetPlayerHandCount.java} | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) rename Mage/src/mage/abilities/dynamicvalue/common/{CardsInTargetHandCount.java => CardsInTargetPlayerHandCount.java} (71%) diff --git a/Mage.Sets/src/mage/sets/legions/DreambornMuse.java b/Mage.Sets/src/mage/sets/legions/DreambornMuse.java index 418e75355e..15de5eceeb 100644 --- a/Mage.Sets/src/mage/sets/legions/DreambornMuse.java +++ b/Mage.Sets/src/mage/sets/legions/DreambornMuse.java @@ -30,7 +30,7 @@ package mage.sets.legions; import java.util.UUID; import mage.MageInt; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; -import mage.abilities.dynamicvalue.common.CardsInTargetHandCount; +import mage.abilities.dynamicvalue.common.CardsInTargetPlayerHandCount; import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; @@ -49,9 +49,13 @@ public class DreambornMuse extends CardImpl { this.subtype.add("Spirit"); this.power = new MageInt(2); this.toughness = new MageInt(2); + + PutLibraryIntoGraveTargetEffect effect = new PutLibraryIntoGraveTargetEffect(new CardsInTargetPlayerHandCount()); + effect.setText("that player puts the top X cards of his or her library into his or her graveyard, where X is the number of cards in his or her hand."); // At the beginning of each player's upkeep, that player puts the top X cards of his or her library into his or her graveyard, where X is the number of cards in his or her hand. - this.addAbility(new BeginningOfUpkeepTriggeredAbility(new PutLibraryIntoGraveTargetEffect(new CardsInTargetHandCount()), TargetController.ANY, false)); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(effect, TargetController.ANY, false)); + } public DreambornMuse(final DreambornMuse card) { @@ -63,7 +67,3 @@ public class DreambornMuse extends CardImpl { return new DreambornMuse(this); } } - -class DreambornMuseEffect { - -} diff --git a/Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetHandCount.java b/Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetPlayerHandCount.java similarity index 71% rename from Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetHandCount.java rename to Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetPlayerHandCount.java index 4bff7fb799..8c7807eb0d 100644 --- a/Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetHandCount.java +++ b/Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetPlayerHandCount.java @@ -10,17 +10,17 @@ import mage.players.Player; * * @author cbrianhill */ -public class CardsInTargetHandCount implements DynamicValue { +public class CardsInTargetPlayerHandCount implements DynamicValue { @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { - Player player = game.getPlayer(sourceAbility.getFirstTarget()); + Player player = game.getPlayer(effect.getTargetPointer().getFirst(game, sourceAbility)); return player.getHand().size(); } @Override public DynamicValue copy() { - return new CardsInTargetHandCount(); + return new CardsInTargetPlayerHandCount(); } @Override From c987ae7a21920f75acb2c5bf5f342868feb94d44 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 17 Jun 2015 00:54:26 +0200 Subject: [PATCH 3/5] [ORI] Added Grasp of the Hieromancer and Heavy Infantry. --- .../magicorigins/GraspOfTheHieromancer.java | 138 ++++++++++++++++++ .../mage/sets/magicorigins/HeavyInfantry.java | 77 ++++++++++ .../sets/riseoftheeldrazi/SnakeUmbra.java | 9 +- 3 files changed, 221 insertions(+), 3 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/magicorigins/GraspOfTheHieromancer.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/HeavyInfantry.java diff --git a/Mage.Sets/src/mage/sets/magicorigins/GraspOfTheHieromancer.java b/Mage.Sets/src/mage/sets/magicorigins/GraspOfTheHieromancer.java new file mode 100644 index 0000000000..811fabbf54 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/GraspOfTheHieromancer.java @@ -0,0 +1,138 @@ +/* + * 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.magicorigins; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.TapTargetEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SetTargetPointer; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerIdPredicate; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class GraspOfTheHieromancer extends CardImpl { + + public GraspOfTheHieromancer(UUID ownerId) { + super(ownerId, 15, "Grasp of the Hieromancer", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); + this.expansionSetCode = "ORI"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Enchanted creature gets +1/+1 and has "Whenever this creature attacks, tap target creature defending player controls." + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield)); + Ability gainedAbility = new GraspOfTheHieromancerTriggeredAbility(new TapTargetEffect(), false); + gainedAbility.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature defending player controls"))); + Effect effect = new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA); + effect.setText("and has \"Whenever this creature attacks, tap target creature defending player controls.\""); + ability.addEffect(effect); + this.addAbility(ability); + + } + + public GraspOfTheHieromancer(final GraspOfTheHieromancer card) { + super(card); + } + + @Override + public GraspOfTheHieromancer copy() { + return new GraspOfTheHieromancer(this); + } +} + +class GraspOfTheHieromancerTriggeredAbility extends TriggeredAbilityImpl { + + + + public GraspOfTheHieromancerTriggeredAbility(Effect effect, boolean optional) { + super(Zone.BATTLEFIELD, effect, optional); + } + + public GraspOfTheHieromancerTriggeredAbility(final GraspOfTheHieromancerTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DECLARED_ATTACKERS; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (game.getCombat().getAttackers().contains(getSourceId()) ) { + UUID defendingPlayerId = game.getCombat().getDefendingPlayerId(getSourceId(), game); + if (defendingPlayerId != null) { + this.getTargets().clear(); + FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls"); + UUID defenderId = game.getCombat().getDefenderId(getSourceId()); + filter.add(new ControllerIdPredicate(defenderId)); + TargetCreaturePermanent target = new TargetCreaturePermanent(filter); + this.addTarget(target); + return true; + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever {this} attacks, tap target creature defending player controls."; + } + + @Override + public GraspOfTheHieromancerTriggeredAbility copy() { + return new GraspOfTheHieromancerTriggeredAbility(this); + } + +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/HeavyInfantry.java b/Mage.Sets/src/mage/sets/magicorigins/HeavyInfantry.java new file mode 100644 index 0000000000..5640bfc4bc --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/HeavyInfantry.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.magicorigins; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.TapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class HeavyInfantry extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public HeavyInfantry(UUID ownerId) { + super(ownerId, 18, "Heavy Infantry", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{W}"); + this.expansionSetCode = "ORI"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // When Heavy Infantry enters the battlefield, tap target creature an opponent controls. + Ability ability = new EntersBattlefieldTriggeredAbility(new TapTargetEffect()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public HeavyInfantry(final HeavyInfantry card) { + super(card); + } + + @Override + public HeavyInfantry copy() { + return new HeavyInfantry(this); + } +} diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SnakeUmbra.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SnakeUmbra.java index 45efa75b0a..5daad05f23 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SnakeUmbra.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SnakeUmbra.java @@ -32,6 +32,7 @@ import java.util.UUID; import mage.constants.*; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.DealsDamageToOpponentTriggeredAbility; import mage.abilities.effects.common.DrawCardSourceControllerEffect; @@ -54,7 +55,6 @@ public class SnakeUmbra extends CardImpl { this.expansionSetCode = "ROE"; this.subtype.add("Aura"); - // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); @@ -63,11 +63,14 @@ public class SnakeUmbra extends CardImpl { this.addAbility(ability); // Enchanted creature gets +1/+1 - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield))); + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield)); // and has "Whenever this creature deals damage to an opponent, you may draw a card." Ability gainedAbility = new DealsDamageToOpponentTriggeredAbility(new DrawCardSourceControllerEffect(1), true); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA))); + Effect effect = new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA); + effect.setText("and has \"Whenever this creature deals damage to an opponent, you may draw a card.\""); + ability.addEffect(effect); + this.addAbility(ability); // Totem armor this.addAbility(new TotemArmorAbility()); From ae2eb8bb5022b603fe0bc41a252e33e4968f1d78 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 17 Jun 2015 00:57:28 +0200 Subject: [PATCH 4/5] Minor changes to Dreamborn Muse. --- Mage.Sets/src/mage/sets/legions/DreambornMuse.java | 3 +-- .../dynamicvalue/common/CardsInTargetPlayerHandCount.java | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Mage.Sets/src/mage/sets/legions/DreambornMuse.java b/Mage.Sets/src/mage/sets/legions/DreambornMuse.java index 15de5eceeb..f2e6b86c25 100644 --- a/Mage.Sets/src/mage/sets/legions/DreambornMuse.java +++ b/Mage.Sets/src/mage/sets/legions/DreambornMuse.java @@ -50,10 +50,9 @@ public class DreambornMuse extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); + // At the beginning of each player's upkeep, that player puts the top X cards of his or her library into his or her graveyard, where X is the number of cards in his or her hand. PutLibraryIntoGraveTargetEffect effect = new PutLibraryIntoGraveTargetEffect(new CardsInTargetPlayerHandCount()); effect.setText("that player puts the top X cards of his or her library into his or her graveyard, where X is the number of cards in his or her hand."); - - // At the beginning of each player's upkeep, that player puts the top X cards of his or her library into his or her graveyard, where X is the number of cards in his or her hand. this.addAbility(new BeginningOfUpkeepTriggeredAbility(effect, TargetController.ANY, false)); } diff --git a/Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetPlayerHandCount.java b/Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetPlayerHandCount.java index 8c7807eb0d..27bab07456 100644 --- a/Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetPlayerHandCount.java +++ b/Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetPlayerHandCount.java @@ -15,7 +15,10 @@ public class CardsInTargetPlayerHandCount implements DynamicValue { @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { Player player = game.getPlayer(effect.getTargetPointer().getFirst(game, sourceAbility)); - return player.getHand().size(); + if (player != null) { + return player.getHand().size(); + } + return 0; } @Override From 568ab914ab7872446ac9ef59f403bc5ebeb67939 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 17 Jun 2015 08:07:00 +0200 Subject: [PATCH 5/5] [ORI] Updated mtg-cards-data.txt (84 cards). --- Utils/mtg-cards-data.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index a2209b0083..8073fae95d 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -26196,6 +26196,8 @@ Akroan Jailer|Magic Origins|1|C|{W}|Creature - Human Soldier|1|1|{2}{W}, {T}: Ta Grasp of the Hieromancer|Magic Origins|15|C|{1}{W}|Enchantment - Aura|||Enchant creature$Enchanted creature gets +1/+1 and has "Whenever this creature attacks, tap target creature defending player controls."| Heavy Infantry|Magic Origins|18|C|{4}{W}|Creature - Human Soldier|3|4|When Heavy Infantry enters the battlefield, tap target creature an opponent controls.| Hixus, Prison Warden|Magic Origins|19|R|{3}{W}{W}{3}{W}{W}|Legendary Creature - Human Soldier|4|44|4|Flash$Whenever a creature deals combat damage to you, if Hixus, Prison Warden entered the battlefield this turn, exile that creature until Hixus leaves the battlefield.$Flash$Whenever a creature deals combat damage to you, if Hixus, Prison Warden entered the battlefield this turn, exile that creature until Hixus leaves the battlefield.| +Gideon, Battle-Forged|Magic Origins|023|M||Planeswalker - Gideon|3|+2: Up to one target creature an opponent controls attacks Gideon, Battle-Forged during its controller's next turn if able.$+1: Until your next turn, target creature gains indestructible. Untap that creature.$0: Until end of turn, Gideon, Battle-Forged becomes a 4/4 Human Soldier creature with indestructible that's still a planeswalker. Prevent all damage that would be dealt to him this turn.| +Kytheon, Hero of Akros|Magic Origins|23|M|{W}|Legendary Creature - Human Soldier|2|1|At end of combat, if Kytheon, Hero of Akros and at least two other creatures attacked this combat, exile Kytheon, then return him to the battlefield transformed under his owner's control.${2}{W}: Kytheon gains indestructible until end of turn.| Sentinel of the Eternal Watch|Magic Origins|30|U|{5}{W}|Creature - Giant Soldier|4|6|Vigilance (Attacking doesn't cause this creature to tap.)$At the beginning of combat on each opponent's turn, tap target creature that player controls.| Valor in Akros|Magic Origins|39|U|{3}{W}|Enchantment|||Whenever a creature enters the battlefield under your control, creatures you control get +1/+1 until end of turn.| Aegis Angel|Magic Origins|273|R|{4}{W}{W}{4}{W}{W}|Creature - Angel|5|55|5|Flying$When Aegis Angel enters the battlefield, another target permanent gains indestructible for as long as you control Aegis Angel.$Flying$When Aegis Angel enters the battlefield, another target permanent gains indestructible for as long as you control Aegis Angel.| @@ -26235,8 +26237,10 @@ Nightmare|Magic Origins|282|R|{5}{B}{5}{B}|Creature - Nightmare Horse|0|00|0|Fly Sengir Vampire|Magic Origins|283|U|{3}{B}{B}{3}{B}{B}|Creature - Vampire|4|44|4|Flying$Whenever a creature dealt damage by Sengir Vampire this turn dies, put a +1/+1 counter on Sengir Vampire.$Flying$Whenever a creature dealt damage by Sengir Vampire this turn dies, put a +1/+1 counter on Sengir Vampire.| Act of Treason|Magic Origins|?|C|{2}{R}{2}{R}|Sorcery|||Gain control of target creature until end of turn. Untap that creature. It gains haste until end of turn.$Gain control of target creature until end of turn. Untap that creature. It gains haste until end of turn.| Chandra's Fury|Magic Origins|?|C|{4}{R}{4}{R}|Instant|||Chandra's Fury deals 4 damage to target player and 1 damage to each creature that player controls.$Chandra's Fury deals 4 damage to target player and 1 damage to each creature that player controls.| +Chandra's Ignition|Magic Origins|?|R|{3}{R}{R}{3}{R}{R}|Sorcery|||Target creature you control deals damage equal to its power to each other creature and each opponent.$Target creature you control deals damage equal to its power to each other creature and each opponent.| Cobblebrute|Magic Origins|?|C|{3}{R}{3}{R}|Creature - Elemental|5|25|2|| Fiery Conclusion|Magic Origins|?|C|{1}{R}{1}{R}|Instant|||As an additional cost to cast Fiery Conclusion, sacrifice a creature.$Fiery Conclusion deals 5 damage to target creature.$As an additional cost to cast Fiery Conclusion, sacrifice a creature.$Fiery Conclusion deals 5 damage to target creature.| +Ravaging Blaze|Magic Origins|?|U|{X}{R}{R}{X}{R}{R}|Instant|||Ravaging Blaze deals X damage to target creature. $Spell mastery — If there are two or more instant and/or sorcery cards in your graveyard, Ravaging Blaze also deals X damage to that creature's controller.$Ravaging Blaze deals X damage to target creature. $Spell mastery — If there are two or more instant and/or sorcery cards in your graveyard, Ravaging Blaze also deals X damage to that creature's controller.| Titan's Strength|Magic Origins|?|C|{R}{R}|Instant|||Target creature gets +3/+1 until end of turn. Scry 1.$Target creature gets +3/+1 until end of turn. Scry 1.| Avaricious Dragon|Magic Origins|131|M|{2}{R}{R}|Creature - Dragon|4|4|Flying$At the beginning of your draw step, draw an additional card.$At the beginning of your end step, discard your hand.| Bellows Lizard|Magic Origins|132|C|{R}{R}|Creature - Lizard|1|11|1|{1}{R}: Bellows Lizard gets +1/+0 until end of turn.${1}{R}: Bellows Lizard gets +1/+0 until end of turn.|