From cf366617701b2aba65ab30f7e24ff3fbc95efd4b Mon Sep 17 00:00:00 2001 From: spjspj Date: Sun, 4 Jun 2017 00:09:06 +1000 Subject: [PATCH 1/3] Implement Ramos, Dragon Engine (C17) --- .../src/mage/cards/r/RamosDragonEngine.java | 134 ++++++++++++++++++ Mage.Sets/src/mage/sets/Commander2017.java | 5 +- Utils/gen-list-unimplemented-cards-for-set.pl | 4 +- Utils/mtg-cards-data.txt | 7 +- 4 files changed, 144 insertions(+), 6 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/r/RamosDragonEngine.java diff --git a/Mage.Sets/src/mage/cards/r/RamosDragonEngine.java b/Mage.Sets/src/mage/cards/r/RamosDragonEngine.java new file mode 100644 index 0000000000..632081e385 --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RamosDragonEngine.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.cards.r; + +import java.util.UUID; +import mage.MageInt; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.BasicManaEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.mana.ActivateOncePerTurnManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SuperType; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.FilterSpell; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.stack.Spell; +import mage.players.Player; + +/** + * + * @author spjspj + */ +public class RamosDragonEngine extends CardImpl { + + public RamosDragonEngine(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{6}"); + + addSuperType(SuperType.LEGENDARY); + this.subtype.add("Dragon"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Whenever you cast a spell, put a +1/+1 counter on Ramos, Dragon Engine for each of that spell's colors. + this.addAbility(new SpellCastControllerTriggeredAbility(new RamosDragonEngineAddCountersEffect(), new FilterSpell("a spell"), false, true)); + + // Remove five +1/+1 counters from Ramos: Add {W}{W}{U}{U}{B}{B}{R}{R}{G}{G} to your mana pool. Activate this ability only once each turn. + Ability ability = new ActivateOncePerTurnManaAbility(Zone.BATTLEFIELD, new BasicManaEffect(new Mana(2, 2, 2, 2, 2, 0, 0, 0)), new RemoveCountersSourceCost(CounterType.P1P1.createInstance(5))); + this.addAbility(ability); + } + + public RamosDragonEngine(final RamosDragonEngine card) { + super(card); + } + + @Override + public RamosDragonEngine copy() { + return new RamosDragonEngine(this); + } +} + +class RamosDragonEngineAddCountersEffect extends OneShotEffect { + + public RamosDragonEngineAddCountersEffect() { + super(Outcome.Benefit); + staticText = "put a +1/+1 counter on {this} for each of that spell's colors"; + } + + public RamosDragonEngineAddCountersEffect(final RamosDragonEngineAddCountersEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player you = game.getPlayer(source.getControllerId()); + Permanent permanent = game.getPermanent(source.getSourceId()); + if (you != null && permanent != null) { + Spell spell = game.getStack().getSpell(this.getTargetPointer().getFirst(game, source)); + if (spell != null) { + int amount = 0; + if (spell.getColor(game).isWhite()) { + ++amount; + } + if (spell.getColor(game).isBlue()) { + ++amount; + } + if (spell.getColor(game).isBlack()) { + ++amount; + } + if (spell.getColor(game).isRed()) { + ++amount; + } + if (spell.getColor(game).isGreen()) { + ++amount; + } + if (amount > 0) { + permanent.addCounters(CounterType.P1P1.createInstance(amount), source, game); + return true; + } + } + } + return false; + } + + @Override + public RamosDragonEngineAddCountersEffect copy() { + return new RamosDragonEngineAddCountersEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Commander2017.java b/Mage.Sets/src/mage/sets/Commander2017.java index fa1e02ff48..83a9a67f0d 100644 --- a/Mage.Sets/src/mage/sets/Commander2017.java +++ b/Mage.Sets/src/mage/sets/Commander2017.java @@ -28,6 +28,7 @@ package mage.sets; import mage.cards.ExpansionSet; +import mage.constants.Rarity; import mage.constants.SetType; /** @@ -46,5 +47,7 @@ public class Commander2017 extends ExpansionSet { super("Commander 2017 Edition", "C17", ExpansionSet.buildDate(2017, 8, 25), SetType.SUPPLEMENTAL); this.blockName = "Command Zone"; + cards.add(new SetCardInfo("Ramos, Dragon Engine", 55, Rarity.RARE, mage.cards.r.RamosDragonEngine.class)); + } -} \ No newline at end of file +} diff --git a/Utils/gen-list-unimplemented-cards-for-set.pl b/Utils/gen-list-unimplemented-cards-for-set.pl index 15df889f21..154f2ae8a6 100755 --- a/Utils/gen-list-unimplemented-cards-for-set.pl +++ b/Utils/gen-list-unimplemented-cards-for-set.pl @@ -112,7 +112,7 @@ close CARD; print ("Unimplemented cards are here: " . lc($sets{$setName}) ."_unimplemented.txt\n"); open ISSUE_TRACKER, "> " . lc($sets{$setName}) ."_issue_tracker.txt"; -print ISSUE_TRACKER "# Cards in set:\n- [x] [Example Card Name] (example URL here)\n"; +print ISSUE_TRACKER "# Cards in set:\n"; my $cn; @@ -125,7 +125,7 @@ foreach $cn (sort keys (%cardNames)) } my $cn2 = $cn; $cn2 =~ s/ /+/g; - print ISSUE_TRACKER "- $x_or_not [$cn] (https://www.google.com.au/search?q=$cn2+MTG&tbm=isch)\n"; + print ISSUE_TRACKER "- $x_or_not [$cn](https://www.google.com.au/search?q=$cn2+MTG&tbm=isch)\n"; } close ISSUE_TRACKER; print ("Tracking Issue text for a new Github issue (similar to https://github.com/magefree/mage/issues/2215): " . lc($sets{$setName}) ."_issue_tracker.txt\n"); diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index cc90e50a04..64dcaed8cf 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -31153,8 +31153,9 @@ Rootwalla|Welcome Deck 2017|27|C|{2}{G}|Creature - Lizard|2|2|{1}{G}: Rootwalla Stalking Tiger|Welcome Deck 2017|28|C|{3}{G}|Creature - Cat|3|3|Stalking Tiger can't be blocked by more than one creature.| Stampeding Rhino|Welcome Deck 2017|29|C|{4}{G}|Creature - Rhino|4|4|Trample (If this creature would assign enough damage to its blockers to destroy them, you may have it assign the rest of its damage to defending player or planeswalker.)| Wing Snare|Welcome Deck 2017|30|U|{2}{G}|Sorcery|||Destroy target creature with flying.| +Scccion of the Ur-Dragon|Commander 2017|246|R|{W}{U}{B}{R}{G}|Legendary Creature - Dragon Avatar|4|4|Flying${2}: Search your library for a Dragon permanent card and put it into your graveyard. If you do, Scion of the Ur-Dragon becomes a copy of that card until end of turn. Then shuffle your library.| The Ur-Dragon|Commander 2017|2|M|{4}{W}{U}{B}{R}{G}|Legendary Creature - Dragon Avatar|10|10|Eminence - As long as The Ur-Dragon is in the command zone or on the battlefield, other Dragon spells you cast cost {1} less to cast.$Flying$Whenever one or more Dragons you control attack, draw that many cards, then you may put a permanent card from your hand onto the battlefield| O-Kagachi, Vengeful Kami|Commander 2017|3|M|{1}{W}{U}{B}{R}{G}|Legendary Creature - Dragon Spirit|6|6|Flying, Trample$Whenever O-Kagachi, Vengeful Kami deals combat damage to a player, if that player attacked you during his or her last turn, exile target nonland permanent that player controls| -Wasitora, Nekoru Queen|Commander 2017|48|M|{2}{B}{R}{G}|5|4|Legendary Creature - Cat Dragon|Flying, trample$Whenever Wasitora, Nekoru Queen deals combat damage to a player, that player sacrifices a creature. If the player can't, you create a 3/3 black, red, and green Cat Dragon creature token with flying| -Ramos, Dragon Engine|Commander 2017|55|M|{6}|6|Legendary Artifact Creature - Dragon|Flying$Whenever you cast a spell, put a +1/+1 counter on Ramos, Dragon Engine for each of that spell's colors. Remove five +1/+1 counters from Ramos: Add {W}{W}{U}{U}{B}{B}{R}{R}{G}{G} to your mana pool. Activate this ability only once each turn.| -Taigam, Ojutai Master|Commander 2017|46|{2}{W}{U}|4|Legendary Creature - Human Monk|Instant, sorcery, and Dragon spells you control can't be countered by spells or abilities.$Whenever you cast an instant or sorcery spell from your hand, if Taigam, Ojutai Master attacked this turn, that spell gains rebound. (Exile the spell as it resolves. At the beginning of your next upkeep, you may cast that card from exile without paying its mana cost.)| +Wasitora, Nekoru Queen|Commander 2017|48|M|{2}{B}{R}{G}|Legendary Creature - Cat Dragon|5|4|Flying, trample$Whenever Wasitora, Nekoru Queen deals combat damage to a player, that player sacrifices a creature. If the player can't, you create a 3/3 black, red, and green Cat Dragon creature token with flying| +Ramos, Dragon Engine|Commander 2017|55|M|{6}|Legendary Artifact Creature - Dragon|4|4|Flying$Whenever you cast a spell, put a +1/+1 counter on Ramos, Dragon Engine for each of that spell's colors. Remove five +1/+1 counters from Ramos: Add {W}{W}{U}{U}{B}{B}{R}{R}{G}{G} to your mana pool. Activate this ability only once each turn.| +Taigam, Ojutai Master|Commander 2017|46|{2}{W}{U}|Legendary Creature - Human Monk|3|4|Instant, sorcery, and Dragon spells you control can't be countered by spells or abilities.$Whenever you cast an instant or sorcery spell from your hand, if Taigam, Ojutai Master attacked this turn, that spell gains rebound. (Exile the spell as it resolves. At the beginning of your next upkeep, you may cast that card from exile without paying its mana cost.)| From 1ea8d3a4c6b371ecf3ba42199ef4369c45b83a5c Mon Sep 17 00:00:00 2001 From: spjspj Date: Sun, 4 Jun 2017 00:12:00 +1000 Subject: [PATCH 2/3] Implement Ramos, Dragon Engine (C17) --- Mage.Sets/src/mage/sets/Commander2017.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/Commander2017.java b/Mage.Sets/src/mage/sets/Commander2017.java index 83a9a67f0d..2caeab115b 100644 --- a/Mage.Sets/src/mage/sets/Commander2017.java +++ b/Mage.Sets/src/mage/sets/Commander2017.java @@ -47,7 +47,7 @@ public class Commander2017 extends ExpansionSet { super("Commander 2017 Edition", "C17", ExpansionSet.buildDate(2017, 8, 25), SetType.SUPPLEMENTAL); this.blockName = "Command Zone"; - cards.add(new SetCardInfo("Ramos, Dragon Engine", 55, Rarity.RARE, mage.cards.r.RamosDragonEngine.class)); + cards.add(new SetCardInfo("Ramos, Dragon Engine", 55, Rarity.MYTHIC, mage.cards.r.RamosDragonEngine.class)); } } From aec720055ae5d1e98367defb7875af2651d530b6 Mon Sep 17 00:00:00 2001 From: spjspj Date: Sun, 4 Jun 2017 00:13:52 +1000 Subject: [PATCH 3/3] Implement Ramos, Dragon Engine (C17) --- Utils/mtg-cards-data.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index 64dcaed8cf..75a407bcb6 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -31153,7 +31153,6 @@ Rootwalla|Welcome Deck 2017|27|C|{2}{G}|Creature - Lizard|2|2|{1}{G}: Rootwalla Stalking Tiger|Welcome Deck 2017|28|C|{3}{G}|Creature - Cat|3|3|Stalking Tiger can't be blocked by more than one creature.| Stampeding Rhino|Welcome Deck 2017|29|C|{4}{G}|Creature - Rhino|4|4|Trample (If this creature would assign enough damage to its blockers to destroy them, you may have it assign the rest of its damage to defending player or planeswalker.)| Wing Snare|Welcome Deck 2017|30|U|{2}{G}|Sorcery|||Destroy target creature with flying.| -Scccion of the Ur-Dragon|Commander 2017|246|R|{W}{U}{B}{R}{G}|Legendary Creature - Dragon Avatar|4|4|Flying${2}: Search your library for a Dragon permanent card and put it into your graveyard. If you do, Scion of the Ur-Dragon becomes a copy of that card until end of turn. Then shuffle your library.| The Ur-Dragon|Commander 2017|2|M|{4}{W}{U}{B}{R}{G}|Legendary Creature - Dragon Avatar|10|10|Eminence - As long as The Ur-Dragon is in the command zone or on the battlefield, other Dragon spells you cast cost {1} less to cast.$Flying$Whenever one or more Dragons you control attack, draw that many cards, then you may put a permanent card from your hand onto the battlefield| O-Kagachi, Vengeful Kami|Commander 2017|3|M|{1}{W}{U}{B}{R}{G}|Legendary Creature - Dragon Spirit|6|6|Flying, Trample$Whenever O-Kagachi, Vengeful Kami deals combat damage to a player, if that player attacked you during his or her last turn, exile target nonland permanent that player controls| Wasitora, Nekoru Queen|Commander 2017|48|M|{2}{B}{R}{G}|Legendary Creature - Cat Dragon|5|4|Flying, trample$Whenever Wasitora, Nekoru Queen deals combat damage to a player, that player sacrifices a creature. If the player can't, you create a 3/3 black, red, and green Cat Dragon creature token with flying|